-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex059.py
More file actions
22 lines (22 loc) · 799 Bytes
/
Copy pathex059.py
File metadata and controls
22 lines (22 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
opcoes = '[1]somar\n[2]miltiplicar\n[3]maior\n[4]novos números\n[5]sair do programa'
op = 0
while op != 5:
num1 = int(input('Informe o 1º número: '))
num2 = int(input('Informe o 2º número: '))
print('')
op = 0
while op not in [4, 5]:
print(opcoes)
op = int(input('Escolha: '))
if op == 1:
print('\nSoma: {} + {} = {}\n'.format(num1, num2, num1+num2))
elif op == 2:
print('\nMultiplicação: {} x {} = {}\n'.format(num1, num2, num1 * num2))
elif op == 3:
maior = num1
if num2 > maior:
maior = num2
print('\nMaior: {} é o maior número.\n'.format(maior))
elif op not in [4, 5]:
print('\n OPÇÃO INVÁLIDA! TENTE NOVAMENTE.')
print('FIM')