import csv
with open('scores.csv') as handle:
reader = csv.reader(handle)
for row in list(reader)[1:]:
user, *scores = row
average = sum([int(score) for score in scores]) / len(scores)
print (
"{user} has average of {average}".format(user=user,average=average)
)
This code won't work in python 2.7 because of the *scores. How do I change this into python 2.7 as I don't know how?
This code was taken from this thread: Row Average CSV Python