Discuss / Python / 交作业~

交作业~

Topic source

Ryan_CL

#1 Created at ... [Delete] [Delete and Lock User]

weight=input('Please input your weight:') height=input('Please input your height:') j=float(weight) k=float(height) BMI=j/(k**2) print(BMI) if BMI<18.5: print('You are too thin!') if 18.5<BMI<25: print('You are normal!') if 25<BMI<28: print('You are a little fat') if 28<BMI<32: print('You are fat') if BMI>=32: print('You are too fat!')

YcanJ

#2 Created at ... [Delete] [Delete and Lock User]

在if条件判断的时候,如果在18.5,25,28这三个数取等就更好了。


  • 1

Reply