Computers and Technology

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,'ore os':100,'red bull':0,'apples':17,'oranges':4}pri ce_key={'tomato soup':1.85,'cheese':3.99,'milk':4,' oreos':7.49,'red bull':0.99,'apples':0.59,'oranges': 1.29}

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 00:30, silasjob09
Jenny wants to look at row 345 and compare it to row 17. what can she do if she wanted to easily adjust to see both at once?
Answers: 3
image
Computers and Technology, 22.06.2019 03:10, victoriadorvilu
This program reads a file called 'test. txt'. you are required to write two functions that build a wordlist out of all of the words found in the file and print all of the unique words found in the file. remove punctuations using 'string. punctuation' and 'strip()' before adding words to the wordlist. write a function build_wordlist() that takes a 'file pointer' as an argument and reads the contents, builds the wordlist after removing punctuations, and then returns the wordlist. another function find_unique() will take this wordlist as a parameter and return another wordlist comprising of all unique words found in the wordlist. example: contents of 'test. txt': test file another line in the test file output: ['another', 'file', 'in', 'line', 'test', 'the']
Answers: 1
image
Computers and Technology, 22.06.2019 04:00, yolo1430
Acetylene is a gas which burns rapidly on its own, and is considered highly explosive. a) true b) false
Answers: 2
image
Computers and Technology, 22.06.2019 07:30, tinasidell1972
An endless cycle of creation and response on the internet is called
Answers: 1
Do you know the correct answer?
Create a two functions: first called grocery_cost(food), where food can be one item or a list of ite...

Questions in other subjects:

Konu
Mathematics, 15.05.2021 03:40
Konu
Computers and Technology, 15.05.2021 03:40