PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
weight = int(input())
#requires integer from the user, which is stored in a variable weight
height = float(input())
#requires float number from the user, which is stored in a variable height. Enter number as a float, otherwise it might output wrong answer.
bmi = weight / height**2
#general formulae to calculate BMI
#if statement. checks what to output, depending on the result of a formulae above.
if bmi < 18.5:
print("Underweight")
#if result is less than 18.5, it will print what is stated above.
elif bmi >= 18.5 and bmi < 25:
#else if 1st statement does not fit, look at this statement. if the result is equal or greater than 18.5 and(but) less than 25, it will print what is below.
print("Normal")
elif bmi >= 25 and bmi < 30:
#else if 1st and 2nd statement do not fit, look at this statement. if the result is equal or greater than 25 and(but) less than 30, it will print what is below.
print("Overweight")
else:
#If the result does not meet any of the statements above, the program will output what is below
print("Obesity")
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run