0
这是遇到我到目前为止的代码错误使用“.format”
def Save_Scores():
global score
score=str(score)
file=open("Class{}.txt",'a').format(group)
file.write("\n")
file.write ("Name: "+name+"\n")
file.write("Score: "+score+"/10\n")
file.close()
quiz()
但是我遇到这个错误时,函数跑
line 42, in Save_Scores
file=open("Class{}.txt",'a').format(group)
AttributeError: '_io.TextIOWrapper' object has no attribute 'format'
您是不是要找“ ”类{} TXT。“ .format(集团)'? – bereal