def male_resting_metabolic_rate(weight,height,age):
'''Takes in the weight, height, and age of a male individual
and returns the resting metabolic rate
Example answers:
male_resting_metabolic_rate(80,180,48) = 1751'''
male_resting_metabolic_rate = int((88.4+13.4*weight)+(4.8*height)-(5.68* age))
if __name__ == "__main__":
print("This program will calculate the resting metabolic rate of an individual")
#Gather the inputs for the functions
weight = input("What is your weight in kilograms?")
height = input("What is your height in centimeters?")
age = int(input("What is your age?" + "(between 1-110):"))
print("Your resting metabolic rate is",male_resting_metabolic_rate(input,input,input))
为什么它说我在第10行和第24行有错误?这是一个全新的问题,如果答案很明显的话,我很抱歉。在
发现了至少两个错误:您需要在python中使用“return”返回值。此外,您还需要按名称传递参数,而不是“input”
试试这个:
相关问题 更多 >
编程相关推荐