[Tutor] stuck on a new program
Ghadir Ghasemi
ghasemmg01 at leedslearning.net
Fri Jan 4 23:15:21 CET 2013
Hi guys I recently created a binary to denary and denary to binary convertor program. It is pretty much finished but I can't get it to work. Can you spot the fault in it please and tell me how it coul be fixed?
print("==================")
print("1 = binary to denary")
print("2 = denary to binary")
return = input("enter an option)
menu_option = get_option()
while True:
menu_option = get_option()
if menu_option == '1':
a = int(input('please enter an 8 bit binary number: '),2); print("the result is", a)
if menu_option == '2':
b= bin(int(input('please enter a denary number: ')));print("the result is", b)
Thank you so much
More information about the Tutor
mailing list