-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex059.py
More file actions
35 lines (34 loc) · 1.05 KB
/
Copy pathex059.py
File metadata and controls
35 lines (34 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from time import sleep
n1 = int(input('Primeiro valor: '))
n2 = int(input('Segundo valor: '))
opção = 0
while opção != 5:
print(''' [ 1 ] Somar
[ 2 ] Multiplicar
[ 3 ] Maior
[ 4 ] Novos números
[ 5 ] Sair do programa''')
opção = int(input('>>>>>> Qual é a sua opção? '))
if opção == 1:
soma = n1 + n2
print('A soma entre {} e {} é igual a {}'.format(n1, n2, soma))
elif opção == 2:
produto = n1 * n2
print('O resultado de {} x {} é {}'.format(n1, n2, produto))
elif opção == 3:
if n1 > n2:
maior = n1
else:
maior = n2
print('Entre {} e {} o valor maior é {}'.format(n1, n2, maior))
elif opção == 4:
print('Informe os números novamente: ')
n1 = int(input('Primeiro valor: '))
n2 = int(input('Segundo valor: '))
elif opção == 5:
print('Finalizando... ')
else:
print('Opção inválida. Tente novamente!')
print('=-=' * 10)
sleep(1)
print('Fim do programa, volte sempre!!')