with open("testt","r") as f1: list1 = f1.readlines() print(list1) list1 = set(list1) with open("test2","r") as f2: list2 = f2.readlines() print(list2) list2 = set(list2) same_data = list1.intersection(list2) print(same_data) for i in same_data: print(i.strip())
原文地址:https://www.cnblogs.com/Xuuuuuu/p/9388301.html
时间: 2024-10-14 06:46:55