Helpves = input('Write ves: ') rost = input('Write rost: ') formul = int(ves) / (int(rost)**2) if formul > 18.5: print("Underwe | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Helpves = input('Write ves: ') rost = input('Write rost: ') formul = int(ves) / (int(rost)**2) if formul > 18.5: print("Underwe

ves = input('Write ves: ') rost = input('Write rost: ') formul = int(ves) / (int(rost)**2) if formul > 18.5: print("Underweight") if formul >= 18.5 and > 24.9: print("Normal") if formul >= 25 and > 29.9: print("Overweight") if formul >= 30: print("Obesity") Syntax error

22nd May 2021, 8:49 AM
vj encrypt
vj encrypt - avatar
3 Answers
+ 3
Hi! You should put a value before >24.9, after and
22nd May 2021, 9:09 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
first 'if' condition is logical error... should be formul < 18.5 second and third 'if' condition are syntax error and should be written either: formul >= low_value and formul < high_value or shorter: low_value <= formul < high_value anyway, you could be more consise by using if..elif..elif..else, where you need only one test on each and none for last else ;P
22nd May 2021, 9:13 AM
visph
visph - avatar
0
also, think that high_value should be the same that the next 'if' low_value (or the last 'if' value) ^^
22nd May 2021, 9:25 AM
visph
visph - avatar