Skip to content

Instantly share code, notes, and snippets.

@NotSebbbb
Last active February 7, 2025 14:55
Show Gist options
  • Save NotSebbbb/1701289c8c77fe48545313c789f953b1 to your computer and use it in GitHub Desktop.
Save NotSebbbb/1701289c8c77fe48545313c789f953b1 to your computer and use it in GitHub Desktop.
This will calculate a users BMI, BMR, and Caloric Intake.
#Name: Sebastian Donahue
#Date: 2/7/25
#Course Number: 113
#Course Name: Intro to python
#Problem Number: Chapter 2 project 1
#Email: sldonahue@student.stcc.edu
#Problem Description: Make a BMI, BMR, and Caloric Intake calculator
weight = float(input("Enter your weight in lbs: "))#This takes down the users weight for the equation.
height = float(input("Enter your height in inches: "))#This takes down the users height for the equation.
age = float(input("Enter your age: "))#This takes down the users age for the equation.
BMI = (weight * 703) / (height * height)#This is the equation to calculate the users BMI
cm = (height * 2.54)#Converts cm into inches
kg = (weight / 2.205)#Converts kg into lbs
male_BMR = (10 * kg) + (6.25 * cm) - (5 * age) + 5#This is the equation to calculate a male users BMR.
female_BMR = (10 * kg) + (6.25 * cm) - (5 * age) - 161#This is the equation to calculate a female users BMR.
calories_male = (male_BMR * 1.55)#This equation calculates a male users caloric intake if they are.
calories_female =(female_BMR * 1.55)#This equation calculates a female users caloric intake if they are.
print("These are your results!")#This tells the users that these are their results.
print(f"BMI: {BMI}")#This tells the user their BMI.
print(f"Male BMR: {male_BMR}")#This tells the user their BMR if they are a male.
print(f"Female BMR: {female_BMR}")#This tells the user their BMR if they are a female.
print(f"Calories needed for a moderately active male: {calories_male}")#This tells the user their calories needed for a moderately active male.
print(f"Calories needed for a moderately active female: {calories_female}")#This tells the user their calories needed for a moderately active female.
input("Press Enter to exit...")#This prevents the script from closing and lets the user view their results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment