IN PYTHON Write a function called check_inventory(inventory, low) that passes a dictionary as inventory and low as...

60.1K

Verified Solution

Question

Programming

IN PYTHON

Write a function called check_inventory(inventory, low) thatpasses a dictionary as inventory and low as an integer, and returnsa sorted list of items that are below an inventory level that isgiven by thelowinteger parameter. The function should work withoutthe low parameter supplied - in which case, you should assume lowis 5. You do not have to worry about reading and writing to a file,that code is provided, and you don’t have to change it. Example: Ifthe inventory is {'banana':3,'apple':10},check_inventory(inventory) will return the list['banana'] and printit in the output file. For the same inventory,check_inventory(inventory, 15) will return the list['apple','banana'] and print it out in the output file.

Answer & Explanation Solved by verified expert
4.5 Ratings (741 Votes)
I had written only the function for inventory since it is saidthat the file    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students