-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbmr_calculator.py
More file actions
53 lines (37 loc) · 995 Bytes
/
Copy pathbmr_calculator.py
File metadata and controls
53 lines (37 loc) · 995 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
Project: BMR Calculator
Author :Meenakshi
Description:
Create a program that calculates a person's Basal Metabolic Rate (BMR).
Requirements:
1. Ask the user for:
- Gender (Male/Female)
- Age
- Height (in cm)
- Weight (in kg)
2. Use the following formulas:
For Men:
BMR = 10 × weight + 6.25 × height − 5 × age + 5
For Women:
BMR = 10 × weight + 6.25 × height − 5 × age − 161
3. Display the calculated BMR.
Sample Input:
Gender: Male
Age: 21
Height: 175
Weight: 70
Sample Output:
Your BMR is: 1673 calories/day
"""
gender = input("Enter Gender (Male/Female): ")
age = int(input("Enter Age: "))
height = float(input("Enter Height (cm): "))
weight = float(input("Enter Weight (kg): "))
if gender.lower() == "male":
bmr = 10 * weight + 6.25 * height - 5 * age + 5
elif gender.lower() == "female":
bmr = 10 * weight + 6.25 * height - 5 * age - 161
else:
print("Invalid gender entered")
exit()
print("Your BMR is:", int(bmr), "calories/day")