Hi All,
i am trying to create a program module with two functions (conversion inches to
centimeters then centimeter to inches, I have my program working although I am
trying to adda Value Error function to my program but cannot seem to it to work:
def Conversion():
print "This program converts the first value from inches to centimeters and
second value centimeters to inches."
print "(1 inch = 2.54 centimeters)"
inches = input("Enter length in inches: ")
centimeters = 2.54 * inches
print "That is", centimeters, "centimeters."
centimeters = input("Enter length in centimeters: ")
inch = centimeters / 2.54
print "That is", inch, "inches."
except ValueError:
print "Invalid digit, please try again."
Conversion()
Any advice would be great, thanks!
JT
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor