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行目にエラーがありますか?答えがかなり明白であれば、私は謝罪します。TypeError:*: 'float'および 'builtin_function_or_method'のサポートされていないオペランドタイプ
'入力、入力、input'を:代わりに、あなたは上で定義された変数の3倍' input'方法!!また、2つの変数の整数への変換がありません。 –
ここにはいくつかの問題があります。最初は 'input'が文字列を返すので、乗算する前にウェイトを数値に変換する必要があります。 'male_resting_metabolic_rate(入力、入力、入力))'は意味がありません、あなたは何をしようとしていましたか? – roganjosh
@ Jean-FrançoisFabreどのように変数を整数に変換するのですか?再び私はこれが本当に基本的なように感じることを謝罪します! –