-
Notifications
You must be signed in to change notification settings - Fork 101
/
BMI Calculator.PY
31 lines (28 loc) · 981 Bytes
/
BMI Calculator.PY
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
def BMI():
Imperial = input("Do you want to use imperial unitsystem? Y or N: ")
if Imperial == "Y":
Height = 2.54 * float(input("Enter your height in inches: "))
Weight = 0.453 * float(input("Enter your Weight in lb: "))
elif Imperial == "N":
Height = float(input("Enter your height in centimeters: "))
Weight = float(input("Enter your Weight in Kg: "))
else:
print("Wrong input write Y or N")
Height = Height/100
BMI = Weight/(Height*Height)
print("your Body Mass Index is: ", BMI)
if(BMI > 0):
if(BMI <= 16):
print("you are severely underweight")
elif(BMI <= 18.5):
print("you are underweight")
elif(BMI <= 25):
print("you are Healthy")
elif(BMI <= 30):
print("you are overweight")
else:
print("you are severely overweight")
else:
("enter valid details")
if __name__ == "__main__":
BMI()