标签:list int and pen for循环 适合 code pre 数据
a = [1,2,3,4,5,6,7,9]
b = [6,7,8,9,10]
s1 = list(set(a).intersection(set(b)))
print(s1)
main_list = []
for i in list_2:
if i in list_1:
main_list.append(i)
main_list = [i for i in list1 if i in list_2]
标签:list int and pen for循环 适合 code pre 数据
原文地址:https://www.cnblogs.com/ronky/p/9427418.html