+ 1

What is the problem in this code

Although there are no errors but all the test cases are not cleared https://code.sololearn.com/cyp1PfSx2yH0/?ref=app

26th Mar 2022, 9:04 AM
Dany Fentom
Dany Fentom - avatar
3 Answers
+ 3
calc() should return wei / ( hei ** 2 ) Or wei / ( hei * hei ) Your code raised <hei> by itself where it should raise <hei> by 2 or multiply <hei> by itself.
26th Mar 2022, 9:18 AM
Ipang
+ 3
Ipang Thanks
26th Mar 2022, 9:53 AM
Dany Fentom
Dany Fentom - avatar
+ 1
def calc(wei,hei): return wei/(hei**hei) def dis(bmi): if bmi<18.5 : print ("Underweight") elif bmi >= 18.5 and bmi<25: print ("Normal") elif bmi>=25 and bmi<30: print ("Overweight ") elif bmi >= 30: print ("Obesity") #wei = 8l #hei= 1.9 wei = int (input()) hei = float (input()) b= calc (wei,hei) dis(b)
26th Mar 2022, 9:06 AM
Dany Fentom
Dany Fentom - avatar