Question: This is for Python, I am getting this error code.. I need my output to come out as is listed in the lower lefthand corner

This is for Python, I am getting this error code.. I need my output to come out as is listed in the lower lefthand corner of the image. I do not understand the This is for Python, I am getting this error code.. I neederror that I am receiving.

Python 3.7.2 Shell Python Hw 4.py - Users/danesnewmacbookpro/Desktop/Python Hw 4.py (3.7.2 1/4 pound butter tC"Here is the recipe that has been recorded") x in ingredients print(x) peServeintCinput("How many does this reciple serve?" ) le-intCinput("How many people must be served?" )) ding the factor to which will be multiplied ple = round(People/Recipeserve) tC"Multiplying the recipe by", multiple) x in ingredients: quant, unit, item-x.split(. ,, Z) if loop to determine if we have fractions or integers in our outputs if in quant: 2 tsp corn syrup 1 can evapourated milk tsp water How many does this reciple serve?16 How many people must be served?25 Multiplying the recipe by 2 Traceback (most recent call last): File "/Users/dane sne macbookpro/Desktop/Python quant int(a)multiple Hw 4.", line 49, in NameError: nameq' is not defined number -0 #1s our fraction greater than 1? num, denom-quant.split #Let's convert those strings into integers numint (num) multiple denom int (denom Ln: 433 Col:1 Here is the recipe that has been recorded 4 tbsp cocoa 1/4 pound butter 2 tsp corn syrup 1 can evapourated milk 1 tsp water #We're seeing if the nu erator is greater or less than the denomi naotr #It's so that we don't have 6/4lbs of butter, instead 1 and 1/4th point of butter if num >denom: number -round (num/denom) numnum- number denom #gcdO is hat gives us the greatest common denominator for our numbers this way, when it's divided, we know it's going to be in its least form common= gcd (num , denom) num int (num/common) denom -int(denom/common) if number0 How many does this recipe serve?16 How many people must be served?25 Multiplying the recipe by 2 8 tbsp cocoa 1/2 pound butten 4 tsp corn syrup 2 can evapourated milk 2 tsp water qstr(num)+"/"+str(denom) else: q-str nmb and"+strCnum)+"+str(denom) else: converting our strings into integers quant - int(quant) multiple qstr quant) print(a, unit, item) print("Serves", RecipeServe multiple) Ln: 51 Serves 32

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!