import csv and then be able to add year revenue

Joined
Jul 12, 2010
Messages
2
Reaction score
0
So basically what i want wanting to do is import a csv file and then have the user specify what year they want to add up all the total revenue.


here is what is in my csv file
2009|1|22|56.23
2009|4|12|86.24
2009|5|20|34.67
2009|6|22|12.67
2009|3|21|795.12
2008|7|4|753.43
2008|8|9|2345.45
2008|9|1|2357.23
2010|5|2|7552.21
2010|3|15|666
2010|4|17|2323.75
2010|5|19|2367.23
2010|6|25|6453
2010|2|6|1267.12


Code:
import csv

print ("Enter the year you want to add up the total revenue.")


reader = csv.reader(open("/revenue.csv", "rb"))
for row in reader:
    print(row)

here is what i have so far...sorry i am very new to python but am really enjoying it. any help would be greatly appreciated.

thanks
keith
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top