I am struggling to write a proper code for this assignment. Can…
Question Answered step-by-step I am struggling to write a proper code for this assignment. Can… I am struggling to write a proper code for this assignment. Can someone please help me? [sales-invoice-finder.py] You are working for a computer parts manufacturer that needs a new program to find sales information based on one of two pieces of informationan invoice identifier (id) ora customer’s last name (lname)Your company logs each parts sale in an Excel file saved as a CSV file called `sales_data.csv` (NOTE: if you think no company would ever do this, you are incorrect: it has been done). The first line in that file contains the column headers: textual descriptions of what data is in each column. The columns are invoice id, a customer’s first name, last name, part number, quantity, and total. Here is the sample `sales_data.csv` file to use: sales_data.csv Download sales_data.csv Your goal is to make this file searchable. Your program should prompt the user for the following inputs, in this order:Whether they want to search using an invoice id (input of `id`) or by a customer’s last name (input of `lname`). The program should reject any input that is not `id` or `lname`, forcing the user to choose one of those two options.The search term, either an `id` value or an `lname` valueAfter the user enters these inputs, the program should open the data file (note that the user does not input the data file), then search within the chosen column (i.e., either `id` or `lname`, but not both) for the input value. If the program finds a match in any invoice recrords, then it it should print (not save) all recorded invoices that match. Finally it should print the total number of records found that match the search term. Here are three examples:Search by invoice id (id) or customer last name (lname)? firstnameERROR: You must enter either ‘id’ for invoice id search or ‘lname’ for customer last name searchSearch by invoice id (id) or customer last name (lname)? lnameEnter your search term: Hutz87681,Lionel,Hutz,218,1,50.8334018,Lionel,Hutz,112,3,88.8834018,Lionel,Hutz,386,3,86.0434018,Lionel,Hutz,216,1,53.544 records found.Search by invoice id (id) or customer last name (lname)? idEnter your search term: 9330393303,Frank,Grimes,392,2,90.7493303,Frank,Grimes,142,3,73.293303,Frank,Grimes,353,1,45.873 records found.Search by invoice id (id) or customer last name (lname)? lnameEnter your search term: Maryville0 records found. Computer Science Engineering & Technology Python Programming SWDV 600 Share QuestionEmailCopy link Comments (0)


