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]
2 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]2 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
Which describes which CTSO each student should join?]
lora16 [44]

Answer:

Answer: CTSO means Career Technical Student Organization. Its helps students excel by providing educational program, events and competitions that supports in the nation's class room. It helps with improving technical skills

Explanation:

4 0
3 years ago
WILL DO A BRIANLY! Use an algorithm to help the Python Turtle get to the finish line in 10 steps by using only the 3 commands be
Alexandra [31]

Answer:

3 3 2 1 1

Explanation:

8 0
3 years ago
What is a computer dedicated to a single function, such as a calculator or computer game? A. TabletB. PDAC.ApplianceD. Minicompu
viktelen [127]

Answer:

C. Appliance.

Explanation:

When a device or machine performs a single function or task, it is commonly referred to as an appliance. Examples of such is an iron, a calculator, a computer game, washing machines, refrigerators, e.t.c

<em>A Personal Digital Assistant (PDA)</em>, is a device, mostly mobile and handheld, that combines various computing features such as telephoning and networking. An example is a tablet. A PDA performs more than a single function.

<em>Minicomputer</em> is a computer usually small in physical size, that is midway in capabilities and support, between a microcomputer and a mainframe computer. An example is also a tablet and our smartphones. Minicomputers are also dedicated to various functions rather than a single function.

In summary, the option that best describes the situation in the question is an appliance.

<em>Hope this helps!</em>

6 0
3 years ago
This formatting option functions like a space bar. However, instead of moving one space at a time, it allows you to move your te
uysha [10]
Would it be Tab. I know that if you are in Microsoft word it works like that.<span />
3 0
2 years ago
.Although SQL is a language, you don’t use it to write applications? (true, false)
Olin [163]

Answer:

The correct answer for the given question is true .

Explanation:

SQL is an Structural query language that is used for accessing the database basically it is an query language which is used for communicating with database by executed the query .

The following are the function of SQL  

SQL can insert the data into database

it can update the record into database

SQL can retrived the database.

We do not use SQL for writing application it is only used to accessing the database  

For create application we can use programming language Like PHP,ASP,JAVA ,PYTHON.etc.

3 0
3 years ago
Other questions:
  • What is the output after the following code executes?
    14·1 answer
  • What is the difference between a learner’s license and an operator’s license?
    5·1 answer
  • which of the following is involved in ordering an outline. A.grouping B.merging C.organizing D.arranging
    10·1 answer
  • After experiencing several issues with an Active Directory domain controller, you have decided to perform a restore operation on
    10·1 answer
  • Consider a Games Expo for Children. Six competitions are laid out for the expo. Tickets are sold according to the age and gender
    11·1 answer
  • Which of the following is another type of brake system used in trucks
    5·1 answer
  • Someone please tell me please y my ps4 controller won’t charge:(
    12·2 answers
  • Who wants brainlyest! NO LINKS how do you message someone on brainly
    10·2 answers
  • outline 4 IDE features that makes software development much faster and more convenient than other alternatives.​
    9·1 answer
  • Which window would show you bindings for local area connection 2?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!