一、列表的情况
test_list = ['1','2','3','4','5']
test_list
输出
['1', '2', '3', '4', '5']
二 、元组的情况
test_tuple=('a','b','c','d','e')
test_tuple
输出
('a', 'b', 'c', 'd', 'e')
三、 写入txt文件 以tuple为例
with open('./test.txt', 'w') as f:
# 如果当前文件夹没有这个文件,它会创建test.txt
# 如果当前文件夹有,就直接写入
f.writelines('\n'.join(test_tuple))
输出