try: height,weight=eval(input()) bmi=weight/(height**2) print("BMI数值为:{0:.2f}".format(bmi)) if bmi<18.5: print("BMI指标为:国际'偏瘦',国内'偏瘦'") elif bmi>=18.5 and bmi<=24: print("BMI指标为:国际'正常',国内'正常'") elif bmi>24 and bmi<=25: print("BMI指标为:国际'正常',国内'偏胖'") elif 25<bmi<28: print("BMI指标为:国际'偏胖',国内'偏胖'") elif 28<=bmi<30: print("BMI指标为:国际'偏胖',国内'肥胖'") else: print("BMI指标为:国际'肥胖',国内'肥胖'") except: print("输入错误")
python123中体重指数测试,我的做法
猜你喜欢
转载自blog.csdn.net/yu0395/article/details/112605517
今日推荐
周排行