Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started