0
The result for last operation is no output why??
weight = int(input()) height = float(input()) BMI = weight / (height**2) if BMI < 18.5: print("Underweight") if BMI >= 18.5: if BMI < 25: print("Normal") if BMI >= 25: if BMI < 30: print("Overweight") if BMI >= 30: print("Obesity")
2 Respostas
+ 2
Correct code indentation is crucial in Python, if you don't indent your code properly, you'll always end up getting a problem.
Read this code (not to run it) to understand about what and how to make proper indentation.
https://code.sololearn.com/cT5BRIbkia21/?ref=app
+ 1
Tareq Elgezawy
You have written nested if block so in this case if 1 case failed then another case will not execute.
You have to use elif here.