Home / Expert Answers / Computer Science / theres-the-question-and-a-screenshot-of-the-txt-file-with-the-info-need-it-done-in-python-using-dic-pa392

(Solved): theres the question and a screenshot of the txt file with the info, need it done in python using dic ...



theres the question and a screenshot of the txt file with the info, need it done in python using dictionaries or tuples 

An online furniture store maintains their records of sales in a file called sales.txt,
attached. Each sales record is stored
File Edit Format View Help
2022-06-26 00:00:00,Armoire,3
2022-06-26 00:20:00, Cupboard,1
2022-06-26 00:40:00, Lamp, 2
2022-06

https://www.mediafire.com/file/xwwiz6y6tz76jb7/sales.txt/file


An online furniture store maintains their records of sales in a file called sales.txt, attached. Each sales record is stored on a separate line and it consists of comma separated fields containing (from left to right) the time of the sale, the name of the product sold, and the corresponding number of items sold, respectively. Write a Python program called sales_inventory.py to determine the total number of items sold for each product listed in the sales.txt file. The program shall display the product names and corresponding numbers of items sold. The product names must be displayed in alphabetical order. The following is the expected output of the program for the input file sales.txt, attached. Armoire: 14 Chair: 9 Clock: 17 Cupboard: 11 Desk: 16 Dresser: 24 Lamp: 26 Sofa: 22 Table: 4 4 File Edit Format View Help 2022-06-26 00:00:00,Armoire,3 2022-06-26 00:20:00, Cupboard,1 2022-06-26 00:40:00, Lamp, 2 2022-06-26 01:00:00,Desk, 3 2022-06-26 01:20:00, Chair,3 2022-06-26 01:40:00, Dresser,2 2022-06-26 02:00:00, Cupboard, 3 2022-06-26 02:20:00,Dresser, 1 2022-06-26 02:40:00,Desk, 3 2022-06-26 03:00:00, Sofa,1 2022-06-26 03:20:00, Sofa,3 2022-06-26 03:40:00,Dresser, 1 2022-06-26 04:00:00, Sofa,2 2022-06-26 04:20:00, Sofa,3 2022-06-26 04:40:00,Clock, 2 2022-06-26 05:00:00, Lamp,3 2022-06-26 05:20:00,Dresser, 3 2022-06-26 05:40:00,Desk, 1 2022-06-26 06:00:00,Desk, 1 2022-06-26 06:20:00, Chair,2 2022-06-26 06:40:00,Desk, 1 2022-06-26 07:00:00, Table,1 2022-06-26 07:20:00, Lamp, 2 2022-06-26 07:40:00, Dresser,3 2022-06-26 08:00:00,Chair,1 2022-06-26 08:20:00,Lamp,3 2022-06-26 08:40:00,Dresser, 2 2022-06-26 09:00:00,Sofa, 1 2022-06-26 09:20:00, Sofa,3 2022-06-26 09:40:00, Cupboard, 1 2022-06-26 10:00:00, Sofa,1 2022-06-26 10:20:00,Oresser,2. 2022-06-26 10:40:00, Cupboard, 2 2022-06-26 11:00:00,Sofa,1 2022-06-26 11:20:00,Dresser, 1 2022-06-26 11:40:00, Lamp,3 2022-06-26 12:00:00, Cupboard, 3. 2022-06-26 12:20:00,Armoire, 2 2022-06-26 12:40:00, Lamp,3 2022-06-26 13:00:00,Armoire, 1 2022-06-26 13:20:00,Armoire, 3 2022-06-26 13:40:00,Desk, 21 2022-06-26 14:00:00,Dresser, 3 2022-06-26 14:20:00, Lamp,3 2022-06-26 14:40:00, Table, 1. 2022-06-26 15:00:00,Desk,3 2022-06-26 15:20:00,Sofa,2 2922-06-26 15:40:00,Lamp, 2 2022-06-26 16:00:00, Clock,21 2022-06-26 16:20:00,Clock, 3 2022-06-26 16:40:00,Chair, 3 2022-06-26 17:00:00, Lanp, 1 2022-06-26 17:20:00,Armoire, 2022-06-26 17:40:00, Lanp,2 2022-06-26 18:00:00,50fa,3 2012-06-26 18:20:00,Table,1 2022-06-26 18:40:00, Table, 1 2022-06-26 19:00:00, Armoire, 2- 2022-06-26 19:20:00,Oresser,3 2022-06-26 19:40:00,5ore,2 2022-06-26 20:00:00, Clock, 2022-06-26 20:20:00, Lamp,2 2022-06-26 20:40:0 3 1022-06-26 21:00:00,Dresser, 1 2022-06-26 21:20:00 Cupboard. 2022-06-26 21:40:00, Clock, 3 2022-06-26 22:00:00 Clock, 2022-06-26 22:20:00,C1OCK, 2022-06-26 22:40:00,Dresser,2 I


We have an Answer from Expert

View Expert Answer

Expert Answer


Total answers posted by the expert is: 2055 Python code for the provided problem statement # open file sales.txt in read mode infile = open("sales.txt", 'r') # declare a dictionary that will store product names as key and their sold units as values
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe