📅  最后修改于: 2022-03-11 14:45:22.145000             🧑  作者: Mango
# define list of places
places = ['Berlin', 'Cape Town', 'Sydney', 'Moscow']
with open('listfile.txt', 'w') as filehandle:
for listitem in places:
filehandle.write('%s\n' % listitem)