Question: Write a code which takes a text file which contains record of product sales. Each record is placed on a separate line, and consists of

Write a code which takes a text file which contains record of product sales. Each record is placed on a separate line, and consists of space separated fields containing ( from left to right )the date / time of the sale, the product name, and the number of product items sold ( quantity ),respectively.Write a Python program to find and display the median quantity sold for each product found in the text file The output must be alphabetized by product name. Read and store the sales data in a dictionary, with product names as dictionary keys while the corresponding values should be the lists of sold quantities. Make use of the dictionary's get method.
( I ALREADY HAVE THE TEXT FILE, I CANT ATTACH IT ON CHEGG, PLEASE JUST WRITE THE CODE WITH IN MIND I HAVE THE TEXT FILE )
Example of how it is in the text file, (PLUS MORE, NOT ONLY THESE)
2023-06-0900:00:00,Skrewdriver,57
2023-06-0900:20:00,Pliers,56
2023-06-0900:40:00,AC/DC Tester,79
2023-06-0901:00:00,Snips,57
2023-06-0901:20:00,Connector,15
2023-06-0901:40:00,Pliers,63
2023-06-0902:00:00,Alligator Clip,95
2023-06-0902:20:00,Pliers,98
2023-06-0902:40:00,Alligator Clip,77
2023-06-0903:00:00,Ring Terminal,95
2023-06-0903:20:00,Connector,65
2023-06-0903:40:00,Alligator Clip,39

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!