subject

You will be reading in the data from the file SalesJan2009.csv. When you do, you need to save all the items from the PRICE field into a list called amtCollected. After you get them all in that list, you will need to create a variable called total that holds the sum of all the numbers in the list. Then create a variable called avg that holds the average of the numbers in the list. Now, print the following strings: "Total is $(total)" and "Average price is $(avg)"Be sure to replace the (total) and (avg) with the value in the variables. Be sure to do casting where necessary. You may use DictReader to read the data from the csv file and then put that dictionary data into the intended list.



I'm terribly confused on how to start on this... but this is how I started it

import csv

amtCollected = []
with open("SalesJan2009.csv", "r+") as csv_file:
csv_reader = csv. reader(csv_file, delimiter= ',')
for line in csv_reader:
print(line[2])

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 13:30
Anetwork security application that prevents access between a private and trusted network and other untrusted networks
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Me ! evelyn is a manager in a retail unit. she wants to prepare a report on the projected profit for the next year. which function can she use? a. pmt b. round c. division d. what-if analysis
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Drag the tiles to the correct boxes to complete the pairs. match the errors with their definitions. #name #value #ref when a formula produces output that is too lengthy to fit in the spreadsheet cell arrowright when you enter an invalid cell reference in a formula arrowright when you type text in cells that accept numeric data arrowright when you type in a cell reference that doesn’t exist arrowright reset next
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
In the blank libreoffice writer document, to start the process of entering a date field into a letter, click on the insert menu. edit menu. file menu. fields menu.
Answers: 3
You know the right answer?
You will be reading in the data from the file SalesJan2009.csv. When you do, you need to save all th...
Questions
question
Social Studies, 09.10.2019 06:30
Questions on the website: 13722367