练习一 写一个程序在要保持文件内容的顺序不变的前提下,去除文件中重复的行。 import os with open('db.txt', 'r', encoding='utf-8') as read_f, \ open('db.txt.swap', 'w', encoding='utf-8') as write_f: s = set() for line in read_f: if line not in s: s.add(line) write_f.write(line) os.remove('d