I'm trying to write a program that will store the results from a quiz against a player's name. I need to always have a record of the past 3 attempts against the users name. I need to be able to store these results for an indeterminate number of players across 3 class groups (hence the 3 arrays). So far i've got this but am getting pretty stuck now.
I've got 3 arrays with 3 fields. The first field is intended for the name and the following 3 to store the score attempts.
cla_1results = ([],[],[],[])
cla_2results = ([],[],[],[])
cla_3results = ([],[],[],[])
file = open("results.txt"")
if statement determines which array to store the results data in depending on the class code
if class_code == "CL1":
cla_1results[0].append(full_name)
cla_1results[1].append(total)
file.write([cla_1results])
elif class_code == "CL2":
cla_2results[0].append(full_name)
cla_2results[1].append(total)
file.write([cla_2results])
elif class_code == "CL3":
cla_3results[0].append(full_name)
cla_3results[1].append(total)
file.write([cla_3results])