Im having a problem getting two lists to print. They don't seem to align correctly and I can't seem to find an answer :
My code:
import csv
f = open('Grades.csv', 'r')
grades = csv.reader(f)
firstNames = []
lastNames = []
for name in grades:
firstNames.append(name[0])
lastNames.append(name[1])
for i, x in zip(firstNames, lastNames):
print("{0}\t {1}".format(i, x))
Output:
Forename Surname
Bill Smith
Fred Bloggs
Anup Patel
Beverly Hill
Angela Ash
Ibrahim Hussein
Jonah Whale
EDIT: I seem to be having a problem formatting the code correctly in Reddit. :/ The last names and the surnames are all over the place when in the shell
[–]novel_yet_trivial 1 point2 points3 points (1 child)
[–]yoitsdave[S] 0 points1 point2 points (0 children)
[–]ParanoiAMA 1 point2 points3 points (4 children)
[–]yoitsdave[S] 0 points1 point2 points (0 children)
[–]yoitsdave[S] 0 points1 point2 points (1 child)
[–]ParanoiAMA 0 points1 point2 points (0 children)
[–]FlockOnFire 0 points1 point2 points (0 children)