Can you please help me with the code.

#!/usr/bin/env python
"""
inchtocm.py

"""

def Inchtocm(inches):
    """Returns 2.54 * inches"""
    return (2.54 * float(inches_number1))

inches = None
while True:
    try:
        inches_number1 = input(input("How many inches you want to convert:
"))
        inches = float(inches_number1)
        print ("You got", Inchtocm(inches), "cm.")
        print ("You converted", inches, "inches to cm.")
        break
    except ValueError:
        print ("This is not a number!")

The code is incomplete and i am not getting a proper output:

How many inches you want to convert: 455
455
This is not a number!
How many inches you want to convert:

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to