#Returning multiple values in the function #Write a function sugar_content that has one parameter - the number of #desserts the person is purchasing for Thanksgiving Dinner. The function #reads the sugar content (in grams) for each dessert. The function finds #and returns the average and the total sugar content. #Write main that reads the number of people who are purchasing #deserts and the number of desserts purchased per person. Use function #sugar_content to find the average and total per person. #According to the American Heart Association (AHA), the maximum amount of #added sugars per day should be about 30 grams. For each person, the #program checks if the average sugar content satisfies #the recommendations of the American #Heart Association (AHA) and prints an appropriate message. def sugar_content(num_des): total=0 for i in range(num_des): sugar=float(input("input sugar content ")) total=total+sugar ave=total/num_des return total, ave #error: #return total - after this statement function #terminates #return ave - this statement is ignored def main(): people=int(input("enter number of people ")) for i in range(people): num_des=int(input("enter number of desserts you bought ")) total_res, ave_res = sugar_content(num_des) print("total sugar for person", i+1, "is" ,total_res) print("average sugar for person", i+1,"is", ave_res) if(ave_res>=30): print("Stop eat sugar") else: print("you are still OK") main()