0

what is the problem?

weight = float(input()) height = float(input()) BMI = float(weight / (height ** 2)) if BMI < 18.5 : print ("Underweight") elif BMI >= 18.5 and BMI < 25 : print ("Normal") elif BMI >= 25 and BMI < 30 : print ("Overweight") elif BMI > 30 : print ("Obesity")

1st Sep 2021, 6:06 AM
Sami Golzadeh
Sami Golzadeh - avatar
2 Réponses
+ 5
blocks are the problem .... (note : the spacing is very important) weight = float(input()) height = float(input()) BMI = float(weight / (height ** 2)) if BMI < 18.5 : print ("Underweight") elif BMI >= 18.5 and BMI < 25 : print ("Normal") elif BMI >= 25 and BMI < 30 : print ("Overweight") elif BMI > 30 : print ("Obesity")
1st Sep 2021, 6:19 AM
Pariket Thakur
Pariket Thakur - avatar
+ 1
# Indentation is a way to highlight blocks of code in Python to get Python to work and increase the readability. # According to PEP 8, spaces are prefered over tabs as indentation method, and 4 spaces should be used per indentation level. Example: if alpha >= 0: do_this() print(”It’s done!”) else: do_that() if beta < 0: do_that_too() print(”That too is now done!”) print(”Program ends.”) # This will increase the readability.
1st Sep 2021, 7:41 AM
Per Bratthammar
Per Bratthammar - avatar