Skip to content

Commit 0480235

Browse files
committed
BMI-Calculator-Changes-Made
1 parent 9745cb1 commit 0480235

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Python/BMICalculator/bmi-calculator.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1+
# Colorama helps adding colors to the terminal output
2+
13
from colorama import Fore, init
24

35
init(autoreset=True)
46

5-
feet, inches = map(int, input(Fore.CYAN + "\nEnter height in feet and inches (example 5'3''): ")[:-2].split("'"))
7+
# Getting Height and Weight of User from the input
8+
9+
height = float(input(Fore.CYAN + "\nEnter your height in metres: "))
610
weight = float(input(Fore.CYAN + "Enter your weight in kgs: "))
711

8-
height = float(feet*0.3048 + inches*0.0254)
12+
# Calculating BMI
13+
914
bmi = round(weight / (height*height), 2)
1015
print("\nYour BMI is: ", bmi)
1116

17+
# Interpreting the result based on value of BMI
18+
1219
if bmi<15.00:
1320
print(Fore.RED + "\nYou are very severely underweight!!!\n")
1421
elif bmi<16.00:

0 commit comments

Comments
 (0)