w=float(input('请告诉我你的体重(kg):'))
h=float(input('请告诉我你的身高(m):'))
BMI=w/(h**2)
if BMI<18.5:
print('你的BMI值为:%.1f,你需要多吃点儿!'%BMI)
elif BMI<=25:
print('你的BMI值为:%.1f,请你继续保持!'%BMI)
elif BMI<=28:
print('你的BMI值为:%.1f,你超重了哟!'%BMI)
elif BMI<=32:
print('你的BMI值为:%.1f,请加强锻炼!'%BMI)
else:
print('你的BMI值为:%.1f,管住嘴迈开腿!'%BMI)
Sign in to make a reply
VH立华
w=float(input('请告诉我你的体重(kg):'))
h=float(input('请告诉我你的身高(m):'))
BMI=w/(h**2)
if BMI<18.5:
print('你的BMI值为:%.1f,你需要多吃点儿!'%BMI)
elif BMI<=25:
print('你的BMI值为:%.1f,请你继续保持!'%BMI)
elif BMI<=28:
print('你的BMI值为:%.1f,你超重了哟!'%BMI)
elif BMI<=32:
print('你的BMI值为:%.1f,请加强锻炼!'%BMI)
else:
print('你的BMI值为:%.1f,管住嘴迈开腿!'%BMI)