Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #leia dois valores e mostre menu
- # 1 soma/2 multi/ 3 maior / 4 novos n / 5 sair
- n1 = int(input('Primeiro valor: '))
- n2 = int(input('Segundo valor: '))
- opcao = 0
- while opcao != 5:
- print(''' [ 1 ] SOMAR
- [ 2 ] MULTIPLICAR
- [ 3 ] MAIOR
- [ 4 ] NOVOS VALORES
- [ 5 ] SAIR DO PROGRAMA''')
- opcao = int(input('>>>>> QUAL É SUA OPÇÃO: '))
- if opcao == 1:
- soma = n1 + n2
- print('A soma entre {} e {} é igual a {}'.format(n1, n2, soma))
- elif opcao == 2:
- multiplicar = n1 * n2
- print('A multiplicação entre {} e {} é igual a {}'.format(n1, n2, multiplicar))
- elif opcao == 3:
- if n1 > n2:
- maior = n1
- else:
- maior = n2
- print('Entre {} e {} o maior valor é {}.'.format(n1, n2, maior))
- elif opcao == 4:
- print('INFORME OS NOVOS VALORES: ')
- n1 = int(input('Primeiro valor: '))
- n2 = int(input('Segundo valor: '))
- elif opcao == 5:
- print('Finalizando....')
- else:
- print('Opção invalida!')
- print('=-=' * 10)
- print('Fim do programa! VOlte sempre!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement