-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday_4_BMI_calculator_US_version.py
More file actions
53 lines (37 loc) · 1.17 KB
/
day_4_BMI_calculator_US_version.py
File metadata and controls
53 lines (37 loc) · 1.17 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
print("Welcome to the 'BMI Calculator (US version)'")
print(' ')
height = float(input("What's is your height in inches?\n(in) "))
print(' ')
weight = float(input("What's is your weight in Pound?\n(lbs) "))
print(' ')
print('Calculating......')
BMI = round(((weight / height ** 2) * 730), 2)
BMI_str = str(BMI)
print(' ')
print('----------------------------------')
print('Your BMI is: ' + BMI_str)
print(' ')
print('According to CDC, your BMI means:')
if BMI <= 18.5:
print("You are underweight")
elif BMI <= 24.9:
print("Awesome! You are healthy")
elif BMI <= 29.9:
print("You are overweight")
else:
print("You are obese")
print('----------------------------------')
print(' ')
print('Adult Body Mass Index or BMI Table from CDC')
print(' ')
from tabulate import tabulate
data = [["Underweight", '18.5'],
["Normal", '18.5 - 24.9'],
["Overweight", '25.0 - 29.9'],
["Obese", '30 and above']]
#define header names
col_names = ["Weight Status", "BMI"]
#display table
print(tabulate(data, headers=col_names, tablefmt="fancy_grid"))
print(' ')
print('Reference: https://www.cdc.gov/healthyweight/assessing/index.html')