#c3ji001. 写文件

写文件

本题需要将文件名为 score.csv 文件生成并打开,并在文件中存入以下内容 【使用循环每一行分开存入】

c = [
    ['Wonder', '97', '84', '59', '66'],
    ['Allen', '100', '99', '77', '58'],
    ['Jodie', '77', '100', '100', '100'],
]

存入的文件名为

score.csv

存入后文件中为以下格式:

Wonder,97,84,59,66
Allen,100,99,77,58
Jodie,77,100,100,100

请你帮它把代码中空出来的地方补充完整(提交完整代码)

c = [
    ['Wonder', '97', '84', '59', '66'],
    ['Allen', '100', '99', '77', '58'],
    ['Jodie', '77', '100', '100', '100'],
]


with open('___①___','w') as f:
    s = ''
    for i in range(___②___):
        lst = c[i]
        for j in range(len(lst)):
            _____③_____
            if j != len(lst) - 1:
                s += ','
            else:
                s += '\n'
    f.write(s)