BMI calculator | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

BMI calculator

there is a problem with my code- can somebody take a look at it? HERE IT IS 👇🏻👇🏻👇🏻 weight = int(input()) height = int(input()) wh = (weight/height) while True: if wh < 18.5: print ("Underweight") while True: if wh >= 18.5: if wh < 25: print ("Normal") while True: if wh >= 25: if wh < 30: print ("Overweight") while True: if wh >= 30: print ("Obesity")

20th Feb 2021, 3:27 AM
♥ KimWooBin Lover ♥
♥ KimWooBin Lover ♥ - avatar
2 Answers
+ 5
hi KimWooBin Lover mass = int(input()) hi = float(input()) //use this formula for bmi... x = mass/hi**2 and remove all the while True loops and then it should work
20th Feb 2021, 3:32 AM
Ollie Q
Ollie Q - avatar
0
#your code goes here weight = float(input()) height = float(input()) bmi = weight / (height ** 2) 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') Copy and paste my answer If it is right please vote for me
19th Aug 2021, 7:18 AM
Sariga.S