Advertisement
bl00dt3ars

02. Calorie Calculator

Nov 14th, 2020 (edited)
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. import math
  2.  
  3. gender = input()
  4. weight = float(input())
  5. height = float(input()) * 100
  6. age = int(input())
  7. activity = input()
  8.  
  9. if gender == "m":
  10.     formula = 66 + (weight * 13.7) + (height * 5) - (age * 6.8)
  11. else:
  12.     formula = 655 + (weight * 9.6) + (height * 1.8) - (age * 4.7)
  13.  
  14. if activity == "sedentary":
  15.     formula *= 1.2
  16. elif activity == "lightly active":
  17.     formula *= 1.375
  18. elif activity == "moderately active":
  19.     formula *= 1.55
  20. else:
  21.     formula *= 1.725
  22.  
  23. print(f"To maintain your current weight you will need {math.ceil(formula)} calories per day.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement