The Harris-Benedict Equation calculates the BMR of a person. For Men the equation is:
For a sedentary man, the maintenance calories:
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.
# 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')
round(maintain,2)