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}

Answers

Answer 1

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.


Related Questions

Sophie used the software development life cycle to write a new program. Sophie planned her program using pseudocode and then wrote her actual code. Which stage of the software development life cycle is Sophie ready for next?

Answers

The stage of the software development life cycle that Sophie is ready for next is Building (software development)

What Is the Software Development Life Cycle?

Software Development Life Cycle is known to be a kind of application of laid down business practices to create software applications.

It is said to be divided into;

Planning RequirementsDesign BuildDocument Test DeployMaintain.

Learn more about software development  from

https://brainly.com/question/25310031

Answer:

Testing

Explanation:

I did it on my test!

HELP, Read the statement.


Washington, DC, is the capital, or seat of government, of the United States.


Which type of keyword is "capital"?


A. an event

B. a title

C. an abbreviation

D. a vocabulary term

Answers

Answer:

d

Explanation:

Answer:

D - A Vocabulary Term

Explanation:

Edge 2022

A hash function is taking an input string of arbitrary length and produces a fixed-sized, short output called a digest.

A. True
B. False

Answers

Answer:

A. True

Explanation:

Digest is actually: a message digest algorithm, or put simply: a hash value, even simpler: the output.

Which of these appliances can be classified as a robot? You can choose 2.

washing machine
sliding window
humidifier
a table lamp
ice cream vending machine

Answers

Answer:

ummmm i think b

Explanation:

the first two are washing machine and humidifier

Pls Help need it before 1pm PLS.
Before taking a photograph, which of the following should you check?

The time of day
The weather report
That the colors in the photograph do not clash
That the lines in the photograph are straight

Answers

Answer:

Explanation:t

the weather

The weather report should you check. Therefore option B is correct.

Before taking a photograph, checking the weather report is important to ensure favorable conditions for capturing the desired shot. Weather can significantly impact the outcome of a photograph.

For instance, bright sunlight might cause harsh shadows or overexposure, while a cloudy day may provide softer, more diffused lighting.

Additionally, weather conditions like rain or strong winds can affect the feasibility and safety of the photo shoot.

By checking the weather report beforehand, photographers can plan accordingly, choose suitable equipment, and make adjustments to achieve the best possible results.

Considering the weather helps to avoid potential issues and enhances the overall quality and success of the photography session.

Therefore option B The weather report is correct.

Know more about The weather report:

https://brainly.com/question/18196253

#SPJ6

Why does it not let me see my messages? In brainy?

Answers

Answer:

Was removed you can only message the brain

Explanation:

What shape will this code make?
import turtle

Mark = turtle.Turtle()

Mark.back(80)

Mark.left(90)

Mark.forward(50)

Mark.right(90)

Mark.forward(80)

Mark.back(80)

Mark.left(90)

Mark.foward(50)

Mark.right(90)

Mark.forward(80)

Answers

it should be the capitalized letter E

How will you identify a file type on your computer?
that
A file type is the standard used to
and information in a computer. All file types have unique
determine which program to use to open a particular file and to access its data.
Help pls

Answers

You use the extension on the end of the file to tell you the type of a file

The extension is the .whatever in the name of the file

Question # 7
Multiple Choice
Which of the following was the primary drawback of dial-up Internet Which of the following shows the relationship between fiber and wireless transmission?


Both fiber and wireless are inexpensive.

Both fiber and wireless are used more commonly than copper is.

Both fiber and wireless have large bandwidths.

Both fiber and wireless have enhanced security features.connections?


hacking

speed

infrastructure

cost

Answers

Answer:

A

Explanation:

which of the following is not a Nintendo game character?
Mario
Donkey Kong
Princess Peach
Sonic the Hedgehog

Answers

Answer:

Sonic the hedgehog cause he's sega

Hello your answers is down below!

Sonic The HedgeHog.

Cryptography has requirements include:

A. easy to compute and not invertible
B. tamper-resistant
C. collision-resistant
D. All the above

Answers

Answer:A i think

Explanation:

1. Write a 400-500 word research report about Burke High School.
2. Use the school’s website to find information on the following topics:
• The Basics – address, school colors, mascot, magnet focus (if they have one)
• History – when the school opened and other facts about the school’s past
• Mission Statement - the school’s stated educational purpose (write it down
word for word)
• Find the Course Guide/Directory/Catalog – This is FULL of good info
• Academics – unique classes/programs (magnet?)
• Specific classes – investigate at least one specific, unique class that is offered
at the school and focus a paragraph about that class
• Principal– name and a couple facts about him/her
• Activities – extra-curricular activities that interest you (sports, drama, music,
clubs)

Answers

Answer:

when is it due

Explanation:

Plz help me on this one

Answers

I can’t see all the answer choices.

Answer:

The sine of the angle = the length of the opposite side. the length of the hypotenuse.

The legnth of the Hypotenuse here is 29. However, because the question is "find sin(a)," then the answer should be "20/29".

Sorry if this is unconvientiant. : )

~Hope I helped

why is lateral reading an important tool when reading material in social media or any online source

Answers

Answer:

When the lateral reader is looking for facts, lateral reading helps the reader understand if the site has an editorial process or expert reputation that would allow one to accept a fact cited on the site as solid.

Explanation:

Write a java program with the following instruction:- class name: prime, instance variable: int n. Member methods:-
prime(): default constructor to initialize n
void input(int x): to assign n with x,
void display(): to check whether the number is prime or not

Answers

class Prime {

int num = 1;

boolean flag = false;

public void input(int x) {

this.num = x;

}

public void display() {

for (int i = 2; i <= num / 2; ++i) {

// condition for nonprime number

if (num % i == 0) {

flag = true;

break;

}

}

if (!flag)

System.out.println(num + " is a prime number.");

else

System.out.println(num + " is not a prime number.");

}

}

May be some bugs as it is an untested code written using a mobile phone

Which energy-related activity does not contribute to acid rain?
a collecting sunlight in a solar panel
b using gasoline in cars
c using fossil fuels in homes and factories
d burning coal in power plants

Answers

Answer:

A

Explanation:

The engines of cars, fossil fuels, and the burning of coal all release chemicals which when formed in/with clouds, can cause acid rain to form. As a non polluting form of production, solar will not contribute.

8. A sprite is a simple spider shaped thing with n legs coming out from a center point. The angle
between each leg is 360 / n degrees.
Write a program to draw a sprite where the number of legs is provided by the user.
For example, when the user enters 6, they should get the following output

Answers

import turtle

s = turtle.Screen()

t = turtle.Turtle()

t.penup()

t.goto(0,-10)

t.pendown()

t.fillcolor("black")

t.begin_fill()

t.circle(10)

t.end_fill()

legs = int(input("How many legs do you want your sprite to have? "))

i = 0

angle = 360 / legs

while i < legs:

   t.penup()

   t.goto(0,0)

   t.pendown()

   t.forward(30)

   t.back(30)

   t.right(angle)

   i += 1

s.mainloop()

You might need to adjust this to your liking. I was able to do everything but draw the triangles at the end of each leg. I hope this helps though.

HELP PLSSSS!!! WHOEVER WILL ANSWER FIRST AND CORRECTLY WILL GET THE CROWN


Which are examples of copyrighted online materials? Check all that apply.



an article from an Internet magazine


lyrics for a song written in the 1800s


photos taken by a student on his blog


a video game that is free for anyone to copy


an illustration sold by an artist on her website


an excerpt from a novel published in 1913

Answers

Answer:

the correct answers are C, E and F

give some examples of technologies that have improved human living conditions

Answers

Answer:

Apps. Apps are a very well-known example of eHealth; most people have tried out an app to improve their mental or physical health at least once. ...

Wearables. Maybe you possess or have seen people wearing devices like the Apple watch, Fitbit, or Pebble. ...

Websites. ...

Virtual Reality. ...

Videoconferencing.

Explanation:

James uses a database to track his school's football team. Which feature in a database allows James to find a specific player by name?

a
Grid

b
Filter

c
Search

d
Sort

Answers

The answer to this question is A

Complete the sentence.
A computer consists of two or more computers connected to each other.


network
switch
server
router

Answers

Answer:

its a network

Explanation:

that is how it is called

QueSUUN TU
Multiple Choice
In the following scenario, which candidate would be best suited for the position? A national sports magazine currently reaches an audience
of men between the ages of 40-70. They want to expand their audience to include younger men and women. In doing market research, the
company has targeted three areas for growth: expanding their online presence, highlighting high school sports, and covering international
sporting events. They are planning on hiring an online content director who will work with a team of professionals to accomplish these three
tasks.
O an art director for a major entertainment magazine wanting to spend more time with his family
O a recent college graduate with experience playing high school soccer
O a former professional baseball player who provides color commentary for a nationally televised sports program
O a popular sports blogger with a marketing degree and an international following

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct answer to this question is:

a popular sports blogger with a marketing degree and an international following

Because the national sports magazine requires a suitable candidate that having an online presence and have knowledge of digital marketing and expand business at the international level. So, they need to hire a person who has knowledge of digital marketing, and have international presence and fame. So they hire a person who is a popular sports blogger with a marketing degree and international following.

 While the other options are not correct because:

The Art director is not a suitable candidate for this job because the art director does not have marketing knowledge and does not know how to expand business at an international level. A recent college graduate is also not suitable because may be he does not know the digital marketing and experience regarding how to expand business internationally.

PLEASE HURRY!!
Look at the image below

Answers

Answer is power and base

Explanation: both power and base are number variables

Why do video games hate me?

Answers

Answer:

cause ur bad

Explanation:

no\][∑∑ωω∨∧⊆⊄¬∅∩║∞°⇅Δ‰НОП muda muda muda muda muda muda muda muda muda wryyyyyyyyyyyy

Answers

i love to eat pickles

Answer:

wut

Explanation:

IM CONFUZZED.....................no\][∑∑ωω∨∧⊆⊄¬∅∩║∞°⇅Δ‰НОП muda muda muda muda muda muda muda muda muda wryyyyyyyyyyyy

what is the purpose for using proper markup language

Answers

Answer:

n computer text processing, a markup language is a system for annotating a document in a way that is syntactically distinguishable from the text, meaning when the document is processed for display, the markup language is not shown, and is only used to format the text.

Explanation:

hold up reen deen ding ding ding ding

Answer:

Without the right tags the content wont be accurately indexed

Explanation:

ap3x approved

hope it helps

You defined a book data type.

class book:
title = ''
author = ''
pages = 0

Then, you created an instance of your book.

myBook = book()

Which statement assigns a value to the title?

title = 'To Kill a Mockingbird'
myBook.title('To Kill a Mockingbird')
myBook.title = 'To Kill a Mockingbird'
myBook.book.title = myBook.title = 'To Kill a Mockingbird'

Answers

Answer:

myBook.title = 'To Kill a Mockingbird'

Explanation:

Correct answer edge 2020

Select the correct answer.
Manuel is writing a sales proposal using a word processor. He wants his company's logo to appear at the top of each page of the proposal
document. Which tool of the word processor should he use?

A)Footer
B)Orientation
C)Header
D)Margins

Answers

The answer is C) Header. If you go in Word and use the header feature, and put a logo there, it appears on all pages.

Answer: it is c

Explanation: that is the only thing that would be at the top

A _______ web page's content can change based on how the user interacts with it.

Answers

Answer:

Dynamic web page shows different information at different point of time.

doing free poitns soon!

Answers

yay i got free 5 points thanks

Answer:

yay thanks

Explanation:

Other Questions
Who was a part of Oklahoma's early Socialism movement also known as "Sooner Socialism"? How would you characterize Wilson's approach to civil rights?I Which detail from Through the Looking-Glass by Lewis Carroll points to the theme that rules of life do not always make sense?Alice wakes up to discover that she had dreamed all her adventures in the Looking-Glass world.Alice is given the choice of only Visitors Bell or Servants Bell to ring at the doorway to her own dinner party.Alice has three cats as pets, and she talks to them as though they are human beings.Alice finds herself between two snoring queens when they both fall asleep after a lullaby. PLEASEE HELP ASAPPPP Which statement best completes the diagram of the ways the differentbranches of government can limit each other's power? Complete the sentence with the correct verb.____ mucho dinero en el banco.0 O Hay If A = {x | x is an odd integer), B = {x | x is an even integer), C = {2,3,4,5), and D = {3,4,5,6), list the element(s) of the following set. Question 1 Which explorer played a key role in sailing around Africa? 3(x+6)+6x+9=7x+8 Solve for x.*A -19/2B 19/2C 2/19D -2/19 Vincent van Gogh only sold one painting in his lifetime. Please help Ill mark you as brainiest Divide using synthetic division, and write a summary statement in fraction form2x^3+3x^2+4x-10/x + 1 Can u please help me! How did Jane Addams and other members of HullHouse have a positive effect on American society? where would you put the commas in the sentence my best friend sarah absolutely loves animals agreed to take care of my dog x f(x)2 32/35 17/37 7/310 -8/314 -28/3f(x)= 2x+20/3f(x)= 5x+52/3f(x)= 5/3x+32/3f(x)= 5/3x+14 What is the unit price of $6.80 for 8 What is the ionosphere and how does it form? What is the effect of a 10 percent price increase on quantity demanded if elasticity is infinite? what is the perpendicular slope of 9x - 5y = 4