-
Notifications
You must be signed in to change notification settings - Fork 2
/
BMI-Calculato_2.py
27 lines (17 loc) · 995 Bytes
/
BMI-Calculato_2.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
print("calculate your BMI")
print("written by Franklin Araque")
#user input
Heightfeet = int(input("enter your height(in feet): "))
Heightinches = int(input("enter your height(in inches): "))
weight = int(input("enter your weight (in lbs): "))
#unit conversions for BMI calculation
FeetToinches= (Heightfeet)*12 #converting feet to inches
FeetandInches = FeetToinches + Heightfeet #adding the converted feet to inches and the inches from the user input together, total weight
# This is a good idea.
#calculate BMI
calcBMI = (weight / (FeetandInches**2)) * 703 #in python "**" means the "^" for raised powers, eg "2^3" = "2**3"
calcBMI = round(calcBMI, 2) #rounding to the second decimal point
#display
print("for height " +str(Heightfeet)+"\""+str(Heightinches) +" and "+str(weight)+ " your BMI is: "+str(calcBMI)) #the "\"" is telling it to print the " inside the two other "", it skips the \
# I like what you did here.
# Testing comment 3