Discuss / Python / 区别????

区别????

Topic source

weight=float(input("your weight please:")) height=float(input("your height please:")) bmi = float(weight/height*height) if bmi<18.5: print('less weight') elif bmi<25 and bmi>18.5 : print('normal weight') elif bmi<28 and bmi>25 : print('normal overly weight') elif bmi<32 and bmi>28 : print('over weight') elif bmi>32 : print('badly over weight') else: print('WRONG')

elif中bmi<25与18.5<bmi<25有区别吗?

height = float(input('请输入身高(m):'))

weight = float(input('请输入体重(kg):')) BMI = weight / (height*height) if BMI < 18.5 : print('过轻') elif BMI <= 25 : print('正常') elif BMI <= 28 : print('过重') elif BMI <= 32 : print('肥胖') else : print('严重肥胖')


  • 1

Reply