我正在处理作业问题,并收到以下错误:
Traceback (most recent call last):
File "/Users//Dropbox/Homework 3 - 2.py", line 15, in <module>
conversion = convert_feet_to_inches(get_feet)
File "/Users//Dropbox/Homework 3 - 2.py", line 4, in convert_feet_to_inches
calculate_conversion = feet*12 TypeError:
unsupported operand type(s) for *: 'function' and 'int'
这是我的代码。我正在尝试将英尺转换为英寸:
def convert_feet_to_inches(feet):
calculate_conversion = feet*12
return calculate_conversion
def get_feet():
ask_for_feet = float(input("Please enter number of feet for conversion "))
return ask_for_feet
def printing_answer():
print (convert_feet_to_inches)
asking_for_feet = get_feet()
conversion = convert_feet_to_inches(get_feet)
print_answer(printing_answer)
我究竟做错了什么?