The Harris-Benedict Equation calculates the BMR of a person. For Men the equation is:

66 + (6.23 x weight in pounds) + (12.7 x height in inches) - (6.8 x age is years)

For a sedentary man, the maintenance calories:

Maintenance = BMR x 1.2

For weight loss, subtract 500 from maintenance. For bulking, add 300 to maintenance.

Calculate how many calories a 23 years old sedentary man must eat per day to maintain his current weight, lose weight and to bulk, given that he is 70kg and 168cm tall.

(Note: 1kg = 2.2 lbs and 1cm = 0.4 inch)
In [1]:
# For better visual display of the result
print ('='*40,'Calorie Tracking','='*40)

# Work with age first as there is no conversion
age = float(input('How old are you? '))

kg = input('How much do you weigh in kg? ')
cm = input('How tall are you in cm? ')

# Dealing with conversion
weight = float(kg)*2.2
height = float(cm)*0.4

# The Harris-Benedict Equation to calculate BMR
bmr = 66 + (6.23*weight) + (12.7*height) - (6.8*age)

# Calorie intake per day
maintain = bmr*1.2
lose = maintain - 500
bulk = maintain + 300


# Print Results
print(f'To maintain his current weight, he must eat {maintain} cal per day')
print(f'To lose weight, he must eat {lose} cal per day')
print(f'For bulking, he must eat {bulk} cal per day')
======================================== Calorie Tracking ========================================
How old are you? 23
How much do you weigh in kg? 70
How tall are you in cm? 168
To maintain his current weight, he must eat 2066.9519999999998 cal per day
To lose weight, he must eat 1566.9519999999998 cal per day
For bulking, he must eat 2366.9519999999998 cal per day
In [2]:
round(maintain,2)
Out[2]:
2066.95
In [ ]: