10-5

while True:
    msg = input('请输入您喜欢编程的原因(按q退出):')
    with open('programe.txt','a') as file_object:
        if msg != 'q':
            file_object.write(msg + '\n')
        else:
            break

猜你喜欢

转载自blog.csdn.net/weixin_42167016/article/details/80727572
今日推荐