-
Notifications
You must be signed in to change notification settings - Fork 0
/
bodymass_index.py
28 lines (21 loc) · 924 Bytes
/
bodymass_index.py
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
print("--------------------")
print("This code shows you your body mass index")
print("--------------------")
height = float(input("Enter your height: "))
height_units = float(input("Press 1 if height in cm and press 2 if height in m: "))
print("---------------------------------------------------------------------")
if height_units == 1:
convert = height / 100
else:
height_units == height_units
print("---------------------------------------------------------------------")
weight = float(input("Enter your weight: "))
weight_units = float(input("Press 1 if weight in g and press 2 if weight in kg: "))
print("---------------------------------------------------------------------")
if weight_units == 1:
weight_units= weight / 1000
else:
weight_units == weight_units
print("********************************")
bodymassindex = weight / (height**2)
print("your body mass index is", bodymassindex)