In the bmi calculator module i got stucked | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

In the bmi calculator module i got stucked

weight=input("input your weight:") height=input("input your height:") bmi=float(weight)/(float(height))**2 print(bmi) if float(bmi) <18.5: print("Underweight") elif 18.5<=float(bmi)<25: print("Normal") elif 25<=float(bmi)<30: print("Overweight") elif float(bmi)>30: print("Obesity") Please tell me where is the bug

3rd Apr 2021, 6:15 PM
Ayushman Halder
Ayushman Halder - avatar
10 Answers
+ 3
This is the correct code. Your logic is correct the only thing is you don't need to give information to the user. That's all
3rd Apr 2021, 6:29 PM
Atul [Inactive]
+ 2
ayushman halder This maybe helps you : #your code goes here weight = int(input()); height = float(input()); bmi = weight/float(height*height); if bmi<18.5: print('Underweight') elif bmi>=18.5 and bmi<25: print("Normal") elif bmi>=25 and bmi<30: print('Overweight') else: print('Obesity')
4th Apr 2021, 9:08 PM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
+ 2
kachi As mentioned earlier posting direct answers is prohibited. If you are posting direct answers also use comments in your code for explanations
5th Apr 2021, 5:53 PM
Atul [Inactive]
+ 1
#In the bmi calculator module i got stucked weight=input() height=input() bmi=float(weight)/(float(height))**2 if float(bmi) <18.5: print("Underweight") elif 18.5<=float(bmi)<25: print("Normal") elif 25<=float(bmi)<30: print("Overweight") elif float(bmi)>30: print("Obesity") #Please tell me where is the bug
3rd Apr 2021, 6:28 PM
Atul [Inactive]
+ 1
My pleasure
4th Apr 2021, 7:03 AM
Atul [Inactive]
+ 1
I don't know if this is what you need the program to do height=float(input("enter height")) weight=float(input("enter you weight")) BMI=weight/(height*height) bMI=float(BMI) print(bMI) if bMI<18.5: print("underweight") elif bMI>=18.5 or bMI<25: print("normal") elif bMI>=25 or bMI<30: print("overweight") if bMI>=30: print("obesity")
5th Apr 2021, 5:44 PM
Benjamin
Benjamin - avatar
+ 1
This is the correct one height=float(input("enter height")) weight=float(input("enter you weight")) BMI=(weight/height)*height print(BMI) if BMI<18.5: print("underweight") elif BMI>=18.5 or BMI<25: print("normal") elif BMI>=25 or BMI<30: print("overweight") if BMI>=30: print("obesity")
5th Apr 2021, 5:56 PM
Benjamin
Benjamin - avatar
0
Thanks Atul ....☺
3rd Apr 2021, 6:31 PM
Ayushman Halder
Ayushman Halder - avatar
0
Ok I will do that next time
5th Apr 2021, 8:36 PM
Benjamin
Benjamin - avatar
0
Where is it stated pls
5th Apr 2021, 8:37 PM
Benjamin
Benjamin - avatar