set函数去重
# -*- coding:utf-8 -*- srcTxt=open(‘1.txt‘,‘r‘).readlines() noRepeat=open(‘2.txt‘,‘w‘) st=set(srcTxt) noRepeat.write(‘‘.join(st))
原文地址:https://www.cnblogs.com/taoyuanming/p/10869623.html
时间: 2024-10-25 10:50:47
set函数去重
# -*- coding:utf-8 -*- srcTxt=open(‘1.txt‘,‘r‘).readlines() noRepeat=open(‘2.txt‘,‘w‘) st=set(srcTxt) noRepeat.write(‘‘.join(st))
原文地址:https://www.cnblogs.com/taoyuanming/p/10869623.html