Skip to content

Commit d3be30f

Browse files
author
codehouseindia
authored
Merge pull request codehouseindia#526 from ron2111/patch-1
Added the BMI Calculator program
2 parents 6f8aa8a + 5baeb51 commit d3be30f

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

BMI Calculator.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#https://www.facebook.com/permalink.php?story_fbid=100915978469862&id=100056543793712
2+
#Subscribed by Code House
3+
4+
print(' BMI CALCULATOR')
5+
name = input('What is your name?')
6+
weight = float(input('What is your weight (in Kgs)?'))
7+
height = float(input('What is your height (in meters)?'))
8+
bmi = weight / (height ** 2)
9+
10+
if bmi<18.5:
11+
print(f"\n{name} is underweight by {bmi} BMI")
12+
print('Eat foods containing high portion of fats and carbohydrates')
13+
elif 18.5<bmi<24.9:
14+
print(f"\n{name} has normal weight by {bmi} BMI")
15+
print('You are living a healthy life and !!!KEEP IT UP!!!')
16+
elif 25.0<bmi<29.9:
17+
print(f"\n{name} is overweight by {bmi} BMI")
18+
print('\nEat foods containing less amount of fats and carbohydrates and do regular exercise.')
19+
else:print(f"\n{name} is obese by {bmi} BMI.\nRegular exercise is very important for you & consult a dietician to plan your diet.")
20+
print('\n |||||||||| THANK YOU ||||||||||')
21+
22+
23+

0 commit comments

Comments
 (0)