Guest User

Untitled

a guest
May 26th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import csv
  2.  
  3. f = open('scores.csv','r')
  4. reader = csv.reader(f) #Start the reader engine
  5. scorelist = [row for row in reader] #Get all the rows from the file read them into a 2d list
  6.  
  7. #Just to prove that it has worked, let's print out the list in a pretty manner.
  8. #Using list unzipping like this makes your program really easy to read.
  9. for fname,lname,score in scorelist:
  10. print("First name:", fname, "Last name:",lname,"Score:",score)
Add Comment
Please, Sign In to add comment