0
Calculator BMI
writes that the syntax is incorrect on line 6, what is the error? i = int (input()) z = float (input()) iz = i/z**2 if iz <18.5: print ("Underweight") elif iz >= 18.5 and <25: print("Normal"), elif iz >= 25 and i/z <30: print ("Overweight") else: print ("Obesity")
2 Respostas
+ 2
elif iz >= 18.5 and ?<25: #iz was missing at ?.
as William Owens stated it is guarenteed iz>=18.5 so no need to ask again.
0
You dont have to test if it is between the values, remember the if will stop at the first true statement
if condition:
do this stuff
elif condition:
do this stuff
else:
if all above are false do this stuff