Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started