+ 1

Anyone please tell error in this code

https://code.sololearn.com/c6hs2wtT3Z4y/?ref=app

20th Jul 2022, 8:06 AM
khushi Agarwal
khushi Agarwal - avatar
2 Answers
+ 3
Hi. You have 2 problems in your code. 1- The power operator in python language is **. 2- You should convert the w variable to float. In the end, your code should look like this: h = float(input()) w = float(input()) x = float(w/(h**2)) if x<18.5: print('underweight') elif x>=18.5 and x<25: print('normal') else: print('obesity')
20th Jul 2022, 8:35 AM
S.M.H Naghavi
S.M.H Naghavi - avatar
+ 1
Khushi Agarwal Pay extra attention to the letter case, the task is observant of this, and you will fail if you print "normal" when you were asked to print "Normal".
20th Jul 2022, 1:47 PM
Ipang