print("🍎 Welcome to the Daily Calorie Tracker 🍎") print("Track your meals, count your calories, and stay on goal!\n")
meals = [] # to store meal names calories = [] # to store calorie amounts
num_meals = int(input("How many meals did you have today? "))
for i in range(num_meals): meal = input(f"\nEnter the name of meal #{i+1}: ") cal = float(input(f"Enter calories for {meal}: ")) meals.append(meal) calories.append(cal)
total_calories = sum(calories) average_calories = total_calories / num_meals
limit = float(input("\nEnter your daily calorie limit: "))
if total_calories > limit:
print("\n
print("\n----- DAILY CALORIE SUMMARY -----") print("Meal Name\tCalories") print("---------------------------------") for i in range(num_meals): print(meals[i] + "\t" + str(calories[i]))
print("---------------------------------") print("Total:\t\t" + str(total_calories)) print("Average:\t" + str(round(average_calories, 2)))
print("\n\nTHANK YOU!")