So I need to create a list which will save the users inputs (a name and their 3 scores) and that will then append this information to one of 3 files. I tried doing this by appending the data to a list and then the list to a dictionary but this doesn't seem to work. I am really new to python so would really appreciate any help. This is my code so far:
dict1 = {}
dict2 = {}
dict3 = {}
list1 = []
list2 =[]
list3 =[]
def main():
name= input ('What is your name?')
for i in range(0,3)
score = input("Enter your score: ")
clss =input('which class?')
if clss==1:
list1.append (name, score)
elif clss==2:
list2.append (name, score)
elif clss==3:
list3.append (name, score)
Here I want to append the list to one of 3 dictionaries depending on the class:
def loop():
x=input('Do you want to make an entry?')
if x=='Yes':
main()
elif x=='No':
sys.exit(0)
loop()