我正在编写一个简单的硬币计数程序。程序每次运行时,文件都应更新。但是文件不会更改。 当前代码:
NewList = (str(volunteer1),str(volunteer2),str(volunteer3),str(volunteer4),str(volunteer5),str(volunteer6))
CoinFile = open("CoinCount.txt", "w")
CoinFile.write('\n'.join(map(lambda x:str(x),NewList)))
CoinFile.close()