+ 1
Anyone please tell error in this code
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')
+ 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".