0
I created a BMI calculator using python, is it correct ?
w=int(input("W")) h=float(input("H")) b=(w)/(h*h) while b<18.5: print("Underweight") break while b<25: if b>=18.5: print("Normal") break while b<30: if b>=25: print("Overweight") break if b>30: print("Obesity")
7 odpowiedzi
+ 2
w=int(input())
h=float(input())
b=w/(h**2)
if (b<18.5):
print("Underweight")
if (b>=18.5 and b<25):
print("Normal")
if (b<30 and b>=25) :
print("Overweight")
if b>=30:
print("Obesity")
+ 3
Why to use loops when it can be done through if else
+ 3
My pleasure
+ 1
Done, thanks atul
+ 1
Viren Shah am also facing same problem, any solution???
0
Hi! If you pass all tests, then yes, its correct
0
On vs code software it is running but, while solving it in sololearn project in python for beginners course, it's saying error. I am confused