I'm trying to add two lists in python. The first list has the results of the first test and the second list the second, I'm trying to make another list with the total marks in it. Heres my code:
import csv
with open ("UASHSDDP3efiles.csv", "r") as csvfile:
reader = csv.reader(csvfile)
list1 = []
for row in reader:
list1.append(row[1])
print (",".join(list1))
with open ("UASHSDDP3efiles.csv", "r") as csvfile:
reader = csv.reader(csvfile)
list2 = []
for row in reader:
list2.append(row[2])
print(",".join(list2))
list3 = [(x + y) for x, y in zip(list1, list2)]
print (list3)
So far for the output all i get is:
>>> 55,25,40,21,52,42,19,47,37,40,49,51,15,32,4
51,36,50,39,53,33,40,57,53,34,40,53,22,42,13
['5551', '2536', '4050', '2139', '5253', '4233', '1940', '4757', '3753', '4034', '4940', '5153', '1522', '3242', '413']