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")
2 Answers
+ 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")
+ 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.