1def introduction_page():
2 print("Welcome to the BMI Calculator")
3 to_start = str(input("Y to start. N to exit"))
4 if to_start in ("Y","y"):
5 print("We will calculate now")
6 return main_page()
7 else:
8 print("exiting")
9
10
11def main_page():
12 found = False
13
14 while not found:
15 weight_store = float()
16 height_store = float()
17 user_weight = float(input("Please enter your weight(kg): "))
18 weight_confirm = str(input("Y to confirm. N to re-enter"))
19 if weight_confirm in("y","Y"):
20 weight_store = weight_store + user_weight
21 while not found:
22 user_height = float(input("Please enter your height(m): "))
23 height_confirm = str(input("Y to confirm. N to re-enter"))
24 if height_confirm in ("Y","y"):
25 height_store = height_store + user_height
26 total_height = (height_store * height_store)
27 total_weight = (weight_store)
28 BMI = (total_weight / total_height)
29 print (int(BMI))
30 if (BMI < 18.5 or BMI <25) :
31 print("Normal Weight")
32 found = True
33 elif (BMI < 25 or BMI < 30):
34 print("Over-weight")
35 found = True
36 elif (BMI < 30 or BMI < 40):
37 print("Obesity")
38 found = True
39 else:
40 print("Morbid Obesity")
41 found = True
42 else:
43 print("Please re-enter")
44 else:
45 print("Please re-enter!")
46
47
48introduction_page()