File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change
1
+ # Colorama helps adding colors to the terminal output
2
+
1
3
from colorama import Fore , init
2
4
3
5
init (autoreset = True )
4
6
5
- feet , inches = map (int , input (Fore .CYAN + "\n Enter 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 + "\n Enter your height in metres: " ))
6
10
weight = float (input (Fore .CYAN + "Enter your weight in kgs: " ))
7
11
8
- height = float (feet * 0.3048 + inches * 0.0254 )
12
+ # Calculating BMI
13
+
9
14
bmi = round (weight / (height * height ), 2 )
10
15
print ("\n Your BMI is: " , bmi )
11
16
17
+ # Interpreting the result based on value of BMI
18
+
12
19
if bmi < 15.00 :
13
20
print (Fore .RED + "\n You are very severely underweight!!!\n " )
14
21
elif bmi < 16.00 :
You can’t perform that action at this time.
0 commit comments