Your convenience store, Snackito Ergo Nom-Nom, has done so well that you have been able to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Your convenience store, Snackito Ergo Nom-Nom, has done so well that you have been able to acquire another business, House of Munchies. They have a lot of goods in inventory, and you want to update your inventory to reflect the new items. Unfortunately, they didn't spend much on IT, so they don't have inventory data in a clean format. What they can give you is the digital receipt from their most recent delivery. The digital receipt is in a text file named receipt.txt. Download it from Canvas. In the cell below, write a function named munchies to do the following: Open the receipt file and loop through it line by line Use regex to find any lines that contain product data Close the receipt file when you have looped through all of it Return a list of dictionaries representing the products you found in the receipt file. Each dictionary should have these keys with an appropriate value: SKU (value should be an integer) productName (value should be a string) quantity (value should be an integer) wholesalePrice (value should be a float) Your function does not need any arguments. An import statement for the re module has been included for you. Reminder: your function must return a list of dictionaries. It should not print anything. Products Purchased 144 bottles of Diet Coke at $0.75/bottle, sku #60609 200 bags of Snack Size Fritos at $.44/bag, sku 22346 (= New Product 50 bottles of Chocolate Milk @ $1.09/bottle, sku 48779 2175 boxes of Peanut Butter Cups @ $4.25/box, sku# 12367 (Non-GMO) 64 bottles of Pepsi at $.75/bottle, sku33284 5 packages of Antacid Tablets at $11.75/package, sku #55455 Out of Stock Not Delivered With This Order 5 gold rings at $5000.00/ring, sku#99999 - 2 turtle doves at $375.50/bird, sku#11111 - 1 partridge in a pear tree at $100.01/tree, sku#77777 =) Your convenience store, Snackito Ergo Nom-Nom, has done so well that you have been able to acquire another business, House of Munchies. They have a lot of goods in inventory, and you want to update your inventory to reflect the new items. Unfortunately, they didn't spend much on IT, so they don't have inventory data in a clean format. What they can give you is the digital receipt from their most recent delivery. The digital receipt is in a text file named receipt.txt. Download it from Canvas. In the cell below, write a function named munchies to do the following: Open the receipt file and loop through it line by line Use regex to find any lines that contain product data Close the receipt file when you have looped through all of it Return a list of dictionaries representing the products you found in the receipt file. Each dictionary should have these keys with an appropriate value: SKU (value should be an integer) productName (value should be a string) quantity (value should be an integer) wholesalePrice (value should be a float) Your function does not need any arguments. An import statement for the re module has been included for you. Reminder: your function must return a list of dictionaries. It should not print anything. Products Purchased 144 bottles of Diet Coke at $0.75/bottle, sku #60609 200 bags of Snack Size Fritos at $.44/bag, sku 22346 (= New Product 50 bottles of Chocolate Milk @ $1.09/bottle, sku 48779 2175 boxes of Peanut Butter Cups @ $4.25/box, sku# 12367 (Non-GMO) 64 bottles of Pepsi at $.75/bottle, sku33284 5 packages of Antacid Tablets at $11.75/package, sku #55455 Out of Stock Not Delivered With This Order 5 gold rings at $5000.00/ring, sku#99999 - 2 turtle doves at $375.50/bird, sku#11111 - 1 partridge in a pear tree at $100.01/tree, sku#77777 =)
Expert Answer:
Answer rating: 100% (QA)
import re def munchies Open the receipt file with openreseptitutxt r as file Read the content ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Pure Bliss Skinfarm and Spa started as a family business in 1983 in the house of its founder Jennifer Elliott. It then expanded to its first outlet on Bay Hills Road and quickly grew to a base of two...
-
Suppose that 1 8 E1 1 E2 1 4 and E, E A = I. Express A as a product of elementary matrices. 1 1 -8 8 () A 1 -8 (A) A (C) A = 4 1 -4 -4 1 1 (D) A = 1 1 1 1 -8 1 1 1 -8 (E) A = 4 (F) A (G) A 4 4 1 1 1...
-
What does it mean that ethics are "good for business"? List and explain at least ten reasons why ethics are good for business.
-
On April 1, Quality Corporation, a U.S. company, expects to sell merchandise to a French customer in three months, denominating the transaction in euros. On April 1, the spot rate is $1.41 per euro,...
-
The free energy for a spontaneous process (a) Decreases (b) Increases (c) Is zero (d) None of these.
-
Using PERT, Adam Munson was able to determine that the expected project completion time for the construction of a pleasure yacht is 21 months, and the project variance is 4. a) What is the...
-
Given the following data for Mehring Company, compute total manufacturing costs, prepare a cost of goods manufactured statement, and compute cost of goods sold. Direct materials used $230,000...
-
The relief time provided by a standard dose of a popular children's allergy medicine averages six hours with a standard deviation of two hours. a. Determine the percentage of children who experience...
-
Using only the case study below. What happened on UA flight 3411 and what were the causes of service failures? What service expectations do customers have of Airlines such as UA? How did these...
-
Explain two single indicators that might be used to measure health.
-
Explain how economic development might be measured.
-
A financial corporation with a \(B B B\) rating has a consumer loan portfolio. An investment banker suggested that this corporation consider issuing an ABS where the collateral for the security is...
-
Explain two market based supply-side policies that might promote economic growth.
-
Explain three uses of national income statistics.
-
The following is the balance sheet of a VRY-SMPL Bank. All the items are recorded based on the book value and they were purchased at par value. Asset Liability 5 year semi-annual Asset Liability 5...
-
Borrowing costs should be recognised as an expense and charged to the profit and loss account of the period in which they are incurred : A. If the borrowing costs relate to qualifying asset B. If the...
-
When there is a dividend payable by the subsidiary at acquisition date, under what conditions should the existence of this dividend be taken into consideration in preparing the fair value adjustments?
-
Five advertising companies jointly buy a jet aircraft. They enter into an agreement whereby each party has the right to use the aircraft for its own purposes some days each year. The parties may...
-
You, CA, have recently been assigned as audit senior for the audit of Open Arms Society (OAS), a not-for-profit organization set up three years ago to help integrate students with disabilities in...
-
Why are some designs called between-subjects designs?
-
What kind of multiple comparisons should you use for repeated-measures data?
-
What underlying assumption do we have with repeated-measures designs that is not necessary for between-subject designs?
Study smarter with the SolutionInn App