-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path037.py
More file actions
24 lines (19 loc) · 799 Bytes
/
037.py
File metadata and controls
24 lines (19 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
valor=int(input('Informe o Valor para conversão:'))
print("Escolha uma das bases para conversão:\n"
"[1]converter em Binário\n"
"[2]converter em Octal\n"
"[3]converter em Hexadecimal")
escolha = int(input('Opção:'))
while(escolha!=0):
if escolha == 1:
print('O valor {} convertido em Binário é {}'.format(valor, bin(valor)[2:]))
escolha = int(input('Opção:'))
elif escolha == 2:
print('O Valor {} Convertido em Octal é {}'.format(valor, oct(valor)[2:]))
escolha = int(input('Opção:'))
elif escolha == 3:
print('O valor {} Convertido em Hexadecimal é {}'.format(valor, hex(valor)[2:]))
escolha = int(input('Opção:'))
else:
print('Escolha invalida Tente Novamente')
print("Fim do Programa")