将两个列表合并为字典
names = ['lilu', 'lucy']
likes = ['swimming', 'eating']
a = dict(zip(names,likes))
print(a)
#{'lilu': 'swimming', 'lucy': 'eating'}
用set去重后使表内元素顺序不变
L = [1, 8, 4, 5, 2, 9, 3, 1, 4, 5]
L1 = list(set(L)) # 去重但顺序可能改变了 [1, 2, 3, 4, 5, 8, 9]
print(L1)
L1.sort(key=L.index) # 将顺序变为与元列表相同
print(L1) # [1, 8, 4, 5, 2, 9, 3]