Discuss / Python / 交作业

交作业

Topic source
在此插入代码

-- coding: utf-8 --

height=float(input('please input your height:')) weight=float(input('please input your weight:')) BMI=weight/(height**2) if BMI<=18.5: print('BMI=%.2f,您的体重过轻'%BMI) elif BMI<=25: print('BMI=%.2f,您的体重正常'%BMI) elif BMI<=28: print('BMI=%.2f,您的体重过重'%BMI) elif BMI<=32: print('BMI=%.2f,您的体重肥胖'%BMI) else: print('BMI=%.2f,您的体重过轻'%BMI)


  • 1

Reply