#test 2 prep (this kind of problems will be 85%) #the recommendation is to eat at least 2000 calories per day for women and at #least 2500 calories per day for men #write a function total_calories that has one parameter - number of meals #per day person ate, for each meal the function reads number of calories. #Function calculates and returns the total number of calories person ate #per day #write main that reads a gender (1 - for women, 0 - for men) #and number of meals person ate. The program calls function #total_calories to find total number of calories per day and then prints #the message if the amount of calories was within recommendations def total_calories(num_meals): sum=0 for i in range(num_meals): calories=int(input("enter number of calories ")) sum=sum+calories return sum def main(): gender=int(input("enter 1 for women and 0 for men ")) num_meals=int(input("enter number of meals ")) total=total_calories(num_meals) print("you ate", total, "calories per day") if(gender==1 and total>=2000): print("you got recommended amount of calories") elif(gender==0 and total>=2500): print("you got recommended amount of calories") else: print("you didn't eat recommended amount") main()