+ 1
Can anyone tell me about unexpected indent error in phython?
#your code goes here w = int(input()) h = float(input()) bmi = w//(h*h) if bmi<18.5: print("under weight") elif bmi>25 and bmi<30: print("overweight") elif bmi>18.5 and bmi<25: print("normal") elif bmi>30: print("obesity")
5 Antworten
+ 4
One of your indent levels don't match the others, at a glance I think it is under if bmi < 18.5:
But I haven't checked your code.
I think the error will give you the line of code where the error occurs for you to find.
Good luck
+ 3
We don't see any error in your code.
If it's a sololearn project, your output should be matched with expected output.
Underweight, Overweight...
+ 1
bmi = w/(h*h) not //
+ 1
Simba it already matched but....☹️
+ 1
#try this
#your code goes here
w = int(input())
h = float(input())
bmi = w//(h*h)
if bmi<18.5:
print("Underweight")
elif bmi>25 and bmi<30:
print("Overweight")
elif bmi>18.5 and bmi<25:
print("Normal")
elif bmi>30:
print("Obesity")