Create a function that takes a dict with the size, the weight in kg, the age, how much sport the person does and whether the person is male or female:
dict = {
"gender": "male",
"height": 180,
"weight": 80,
"age": 20,
"sport": 3
}
Return the basal metabolic rate of the person rounded to one decimal place. The formula is:
Once you’ve calculated your BMR, this is then put into the Harris Benedict Formula , which calculates your total calorie intake required to maintain your current weight. This is as follows:
BMR({
"gender": "female",
"height": 170,
"weight": 65,
"age": 25,
"sport": 5
}) ➞ 2801.2
BMR({
"gender": "male",
"height": 180,
"weight": 80,
"age": 20,
"sport": 3
}) ➞ 2994.5
BMR({
"gender": "female",
"height": 170,
"weight": 70,
"age": 40,
"sport": 2
}) ➞ 1996.5
Round the final result to 1 decimal place.