计算使用python编码的BMI时出错

时间:2019-01-26 10:38:03

标签: python python-3.x

运行代码时出现错误

#script to calculate the BMI of a person

print ("Enter your heights in meters")
height = float(raw_input())
print ("Enter your Weight in Kilograms")
weight = float(raw_input())

BMI = weight/(height*height)

print (BMI)

1 个答案:

答案 0 :(得分:0)

raw_input仅存在于Python 2.x中。您应该在Python 3中使用input()