0

Why my code is not working

w= int(input()) h= input() bmi= w / ((h)**2) if bmi > 18.5: print("Underweight") if bmi >=25: print("Normal") if bmi >=30: print("overweight") else: print("obesity")

2nd Feb 2022, 7:31 PM
Divyesh Ranwa
Divyesh Ranwa - avatar
1 Answer
+ 1
second input is of float type input, you need to convert to float otherwise it's error. Use h = float( input() ) You need to learn about indentation well in python. If bmi is <18.5 , your code put no output. If input is >=30 ex: 35 then it outputs Underweight Normal Overweight 3 outputs. wrong answer. so it needs proper indentation. Try again and reply..
2nd Feb 2022, 7:41 PM
Jayakrishna 🇼🇳