Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import csv
- f = open('scores.csv','r')
- reader = csv.reader(f) #Start the reader engine
- scorelist = [row for row in reader] #Get all the rows from the file read them into a 2d list
- #Just to prove that it has worked, let's print out the list in a pretty manner.
- #Using list unzipping like this makes your program really easy to read.
- for fname,lname,score in scorelist:
- print("First name:", fname, "Last name:",lname,"Score:",score)
Add Comment
Please, Sign In to add comment