I'm trying to get Python to say:
 
Enter the height (in metres):
 
and convert whatever value to feet and inches. I've done this part as you can 
see below, but how can I terminate the program when user inputs a height less 
than 1/2 inch?
How can I also take into account all the cases that need an exception?
 
 
metres = float(raw_input("Enter the height (in metres): "))total_inches = 39.37 
* metresfeet = int(total_inches/12)inches = int(round(total_inches - 
feet*12))if feet>=1:    print "It is " + str(feet) + " feet " + str(inches) + ' 
inches high.'if feet<1 and inches<0.5:    print "Error."
_________________________________________________________________
Windows Live Messenger. Multitasking at its finest.
http://www.microsoft.com/windows/windowslive/messenger.aspx
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to