0
How to create BMI calculator in Python? Any advance level programmer can guide?
4 Respostas
+ 5
Muhammad Hassan yar ,
are you talking about the code coach exercice from "python for beginners" tutorial?
in this case:
before we are going to help you, please present your attempt here. if you haven't done a try by yourself so far, please do so. create your code in playground and post the link to it here.
please also provide a proper task description with sample of input and output.
thanks!
+ 1
Mladen please don't just give people the solution they don't learn that way.
Also, the first condition in your code has to be >= 30 instead of > 30.
0
Thanks bro
- 1
weight = float(input())
height = float(input())
BMI = weight / height ** 2
if BMI > 30:
print("Obesity")
elif 30 > BMI >= 25:
print("Overweight")
elif 25 > BMI >= 18.5:
print("Normal")
else:
print("Underweight")