1.通过键盘输入若干学生的学号,姓名,高数,英语,计算机5项数据,将这些学生成绩数据写入文件,文件名为“学生成绩表.txt”。
3条回答 默认 最新
CSDN专家-深度学习进阶 2021-06-25 16:15关注输入后对文件进行操作即可
id=input() name=input() math=input() english=input() computer=input() with open('学生成绩表.txt', 'w') as f1: f1.write('id:%s,name:%s,math:%s,english:%s,computer:%s' % (id, name, math, english, computer))本回答被题主选为最佳回答 , 对您是否有帮助呢?评论 打赏 举报解决 1无用