-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBMR.py
More file actions
26 lines (23 loc) · 739 Bytes
/
BMR.py
File metadata and controls
26 lines (23 loc) · 739 Bytes
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
# making a BMR calculater
name=input("what is your name? -->")
sex=input("are you a male or female? -->")
age=int(input("how old are you? -->"))
height=float(input("what is your height? -->"))
weight=int(input("what is your weight? -->"))
def ft2cm(height):
import math
a=(math.floor(height)*12)
b=(height-(a/12))*12
c=a+b
height_cm=c*2.54
return height_cm
def bmr_calculater(name,weight,height_cm,sex,age):
if sex=="girl":
bmr=655+(9.6*weight)+(1.8*height_cm)-(4.7*age)
else:
bmr=66+(13.7*weight)+(5*height_cm)-(6.8*age)
messege= name.capitalize()+"\'s bmr is "+str(bmr)
return messege
height_cm=ft2cm(height)
print("\n")
print(bmr_calculater(name,weight,height_cm,sex,age))