我不太确定自己在做什么错。我查找了类似的主题,并发现其他用户具有相似的BMI公式。当我输入测试编号(体重为160,身高为6)时,我得到3124.444444444445,这不应该是答案。我发誓我错过了一些重要的事情,或者我输入了一个非常粗糙的BMI公式版本。
weight = int(input("Insert weight here (in pounds): "))
height = float(input("Insert height here (in inches): "))
bmi = float((weight / (height * height)) * 703)
print("Your bmi is: ", bmi)
编辑:好的,我犯了一个愚蠢的错误。嗯,谢谢大家的帮助。
您需要以英寸为单位的高度:6英尺高为72英寸。
此更正应为您提供大约21.70的BMI
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句