A set of keyboard input student information, saved to a file, save the form for each student name per line

import os
while True:
    name=input("请输入一个名字")
    with open("F:\\ aa.txt","a",encoding="UTF-8" )as n:
        n.writelines(name+"\n")
        n.close()

Published 16 original articles · won praise 0 · Views 121

Guess you like

Origin blog.csdn.net/beyongboy/article/details/104878876