1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Margaret [11]
3 years ago
7

Create a two functions: first called grocery_cost(food), where food can be one item or a list of items from the stock and price

dictionaries, the second is called stock_check(stock_list) where a store manager can check if stock numbers are at a minimum value.grocery_cost: loops through the argument food, notes the price, checks the stock, calculates and prints the total cost and changes the stock number. You will need to use a for statement to loop through the items in food and an if statement to check and update the stock (substract one from the stock for each item in the stock).Stock_check: loops through each item in the stock dictionary and uses an if-statement to print a statement if stock is less than 5.Given:stock_key={'tomato soup':20,'cheese':10,'milk':25,'oreos':100,'red bull':0,'apples':17,'oranges':4}price_key={'tomato soup':1.85,'cheese':3.99,'milk':4,'oreos':7.49,'red bull':0.99,'apples':0.59,'oranges':1.29}
Computers and Technology
1 answer:
Elena L [17]3 years ago
6 0

Answer:

stock_key={'tomato soup':20,'cheese':10,'milk':25,'oreos':100,'red bull':0,'apples':17,'oranges':4}

price_key={'tomato soup':1.85,'cheese':3.99,'milk':4,'oreos':7.49,'red bull':0.99,'apples':0.59,'oranges':1.29}

def grocery_cost(*args):

   total_cost = 0

   for arg in args:

       if arg in stock_key.keys():

           stock_key[arg] -= 1

           total_cost += price_key[arg]

   print( f"Total cost of groceries: {total_cost}")

def stock_check():

   for key, value in stock_key.items():

       if value < 5:

          print(f"The stock \"{key}\" is less than 5.")

grocery_cost('apples', 'oranges','milk', 'oreos','cheese')

stock_check()

Explanation:

The functions of grocery_cost and stock_check are python defined functions. The former accepts a list of one or more items and calculates the total cost of the grocery items from the stock and price dictionary while the latter check the size of the stock in the food store.

You might be interested in
Auditors often make use of computer programs that perform routine processing functions, such as sorting and merging. These progr
ohaa [14]

Answer:

UTILITY PROGRAM

Explanation:

Utility program are program that perform routine processing function such as sorting and merging. They are often used by auditors to performs a very specific task, usually related to managing system resources. It contain a number of utilities for managing disk drives, printers, and other devices.

Utility program also performs specific task related to the management of computer functions, resources, password protection, memory management, virus protection, and file compression.

5 0
4 years ago
Do this pls and i will give you 25 blls
saveliy_v [14]

Answer:

√A*BCD-DC(B-A)*BA(CD)

Explanation:

3 0
3 years ago
Read 2 more answers
Phillip is a wellness counselor. He has created a newsletter as a service for his clients. He needs to decide upon a method to d
Alexus [3.1K]
The best technology that Philip could use is the Email Newsletters.  <span> Sent on a regular basis, a content-based email newsletter not only helps you stay on top, but also showcases your updates concerning wellness,  C</span>reate a newsletter that will engage your users.  <span>Ensure that each content is educational, informative, and short but clear. </span>
3 0
4 years ago
What is ment by creative middle way solution
SOVA2 [1]
Looking for a way to resolve conflicting values that comes as close as possible to satisfying all relevant obligation
7 0
3 years ago
Can anyone answer this​
xxMikexx [17]

Answer:

I can't answer sorry

Explanation:

7 0
3 years ago
Other questions:
  • In object-oriented analysis, objects possess characteristics called _____.â
    14·1 answer
  • What are three situations when recursion is the only option available to address problems?
    10·1 answer
  • 1) Open the file DiceSimulation.java attached below. Create a new project on NetBeans called DiceSimulation. Copy the code from
    13·1 answer
  • Given the number of every players of two cricket team to find the winner team and find total half-century,in C program
    14·1 answer
  • I need help, thank you
    7·1 answer
  • Need help plz with the code
    12·1 answer
  • Q2. What does JSON stand for? Can you give an example of a JSON object. Q3. What is the purpose of a "projection" in a find quer
    10·1 answer
  • Imagine that your parents were starting a small business, and they wanted to upgrade their data storage. Would you recommend a f
    11·1 answer
  • How do I delete my Brainly account?
    6·2 answers
  • Quick!<br>who can solve this?<br><br>:}<br>:}<br>:}<br>:}<br>:}​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!