height = input('height:') weight = input('weight:') a = float(height) b = float(weight) BMI = b / (a * a) if BMI < 18.5: print ('too light {0:.1f}'.format(BMI)) elif BMI >= 18.5 and BMI < 25: print ('normal {0:.1f}' .format(BMI)) elif BMI >= 25 and BMI < 28: print ('fat {0:.1f}' .format(BMI)) elif BMI >= 28 and BMI < 32: print ('very fat {0:.1f}'.format(BMI) ) elif BMI >= 32 : print ('sincere fat{0:.1f}'.format(BMI))
Sign in to make a reply
张小顺的
height = input('height:') weight = input('weight:') a = float(height) b = float(weight) BMI = b / (a * a) if BMI < 18.5: print ('too light {0:.1f}'.format(BMI)) elif BMI >= 18.5 and BMI < 25: print ('normal {0:.1f}' .format(BMI)) elif BMI >= 25 and BMI < 28: print ('fat {0:.1f}' .format(BMI)) elif BMI >= 28 and BMI < 32: print ('very fat {0:.1f}'.format(BMI) ) elif BMI >= 32 : print ('sincere fat{0:.1f}'.format(BMI))