1weight = float(input('What is your weight? (Kg) '))
2height = float(input('What is your height? (Mtr) '))
3bmi = weight/(height*height)
4
5if bmi <= 18.5:
6 print('Your BMI is', bmi, 'which means you are underweight')
7
8elif 18.5 < bmi < 25:
9 print('Your BMI is', bmi,'which means you are normal')
10
11elif 25 < bmi < 30:
12 print('your BMI is', bmi,' which means you are overweight')
13
14elif bmi > 30:
15 print('Your BMI is', bmi,'which means you are obese')
1print("Welcome to BMI calculator, by Abthahi Tazrian.")
2
3# Offer Measurement Conversions
4
5Offer_Conversions = input("Would you like to convert your imperial units to metric? (yes / no): ")
6
7if Offer_Conversions == "yes":
8 Imperial_Weight = input("What is your weight in pounds?: ")
9 Imperial_Height = input("What is your height in feet (decimals)?: ")
10
11 Imperial_Weight = float(Imperial_Weight)
12 Imperial_Height = float(Imperial_Height)
13
14 Metric_Converted_Weight = Imperial_Weight * 2.205
15 Metric_Converted_Height = Imperial_Height * 30.48
16
17 Metric_Converted_Weight = str(Metric_Converted_Weight)
18 Metric_Converted_Height = str(Metric_Converted_Height)
19
20 print("Your metric weight is " + Metric_Converted_Weight + " kg, please note this for the next stage.")
21 print("Your metric height is " + Metric_Converted_Height + " cm, please note this for the next stage.")
22 print("--")
23elif Offer_Conversions == "no":
24 print("--")
25
26# Data Collection
27
28Age = input("Put in your age: ")
29Weight = input("Put in your weight in KG: ")
30Height = input("Put in your height in CM: ")
31
32# BMI Formula Calculation
33
34Weight = float(Weight)
35Height = float(Height)
36
37Height_Squared = Height * Height
38BMI_Formula_Assisted = Weight / Height_Squared
39BMI_Formula_Completed = BMI_Formula_Assisted * 10000
40
41# Health Chart Display
42
43BMI_Formula_Completed = str(BMI_Formula_Completed)
44
45print("You have a BMI score of " + BMI_Formula_Completed + ".")
46
47BMI_Formula_Completed = float(BMI_Formula_Completed)
48
49if BMI_Formula_Completed <= 18.5:
50 print("You are underweight, consider gaining weight to bring your BMI to between 20 and 25.")
51elif BMI_Formula_Completed <= 25:
52 print("You are perfectly healthy, with a BMI within a healthy range of between 20 and 25.")
53elif BMI_Formula_Completed <= 30:
54 print("You are overweight, speak to a doctor about setting yourself a new target BMI between 20 and 25.")
55elif BMI_Formula_Completed >= 30.1:
56 print("You are obese, you need to lower your BMI to between 20 and 25 or else you may be at risks.")