print "How old are you?",
age = raw_input()
print "How tall are you in inches?",
height = raw_input()
print "How much do you weigh in pounds",
weight = raw_input()
print "So, you are %r years old, %r inches tall, and %d kilograms." % (
age, height, weight / 2.2)
所以我是代码的新手,这是我的代码。当我使用终端编译它时,我明白了:
How old are you? 1
How tall are you in inches? 1
How much do you weigh in pounds 1
Traceback (most recent call last):
File "ex11.py", line 9, in <module>
age, height, weight / 2.2)
TypeError: unsupported operand type(s) for /: 'str' and 'float'
有人可以向我解释我做错了吗?