A cookie recipe calls for the following ingredients:
• 1.5 cups of sugar
• 1 cup of butter
• 2.75 cups of flour
The recipe produces 48 cookies with this amount of ingredients. Write a program that asks the user how many cookies they want to make and then displays the number of cups of each ingredient needed for the specified number of cookies in the following format:

You need 5 cups of sugar, 3 cups of butter, and 7 cups of flour.

Note: Don’t worry about formatting the numbers in the output.

Respuesta :

def cookie_Recipe(recipe):

   

   sugar=(0.03125*recipe)

   butter=(0.02083333333*recipe)

   flour=(0.05729166666*recipe)

   LF1=round(sugar, 2)

   LF2=round(butter,2)

   LF3=round(flour, 2)

   print("You will need:")

   print(LF1, "cups of sugar")

   print(LF2, "cups of butter")

   print(LF3, "cups of flour")

   print("To make", recipe, 'cookies')

recipe=int(input("How many cookies do you want to make?\n"))

cookie_Recipe(recipe)