[Tutor] More Converter

wackedd at mac.com wackedd at mac.com
Fri Mar 21 20:03:36 CET 2008

I am still in need of more help. Currently I am just trying to get one conversion down, as then I can duplicate it. However I am not sure how to make it Convert. Currently I am working with:

# Converter
Original = raw_input("Insert inches, feet ")
To = raw_input("Insert inches, feet ")
Variable = int(raw_input("Insert Amount to Convert "))
if Original == raw_input(feet) and To == raw_input(inches):
        print Variable*12

I want it so that if the raw_input from Original is feet, and the raw_input from To is inches it will print the raw_input from Variable*12.
I always get this error message though

Traceback (most recent call last):
  File "/Users/donaldlucas/Documents/Python Scripts/Converter.py", line 5, in <module>
    if Original == raw_input(feet) and To == raw_input(inches):
NameError: name 'feet' is not defined

I would assume that this is because I am not doing the if Orignal== part correctly. Help me?

More information about the Tutor mailing list