Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribederror 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Science Project Ideas In Health Care Volume 1

Authors: Zemelak Goraga

1st Edition

B0CPX2RWPF, 979-8223791072

More Books

Students also viewed these Databases questions

Question

What does stickiest refer to in regard to social media

Answered: 1 week ago

Question

4-6 Is there a digital divide? If so, why does it matter?

Answered: 1 week ago