Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q2 Farmer's Market There are four farmers at a farmer's market, each selling the same three vegetables: artichokes, brussel sprouts, and carrots. The current inventory

image text in transcribed

Q2 Farmer's Market There are four farmers at a farmer's market, each selling the same three vegetables: artichokes, brussel sprouts, and carrots. The current inventory is: Xavier has 9 units of each; Yazmin has 7 artichokes, 4 brussel sprouts, and 11 carrots, Zach has run out of artichokes and brussel sprouts, but has a surfeit of carrots - clocking in at 21. Create a dictionary containing each farmer as a key, and as a value a dictionary with his/her inventory. In [ ]: Create a new dictionary that contains just the produce and the total inventory for the farmer's market---use loops, not manual addition. In fact, just to make things difficult, do not even manually set the keys of the tot_inv dict, use loops and conditionals to do this too. In [ ]: The prices are: artichokes cost 4, brussel sprouts and carrots both cost 2. Create a dictionary containing this information, then another dictionary with each farmer as a key, and the current value of his/her inventory as the value. Again, automate the whole thing. t:8888bconvert/html/Downloads/PS1 (1).ipynb?download=false 2/5 21 PS1 (1) In [ ]

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

Step: 3

blur-text-image

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

Genetic Databases

Authors: Martin J. Bishop

1st Edition

0121016250, 978-0121016258

More Books

Students also viewed these Databases questions