列表元组转其他 # 列表转集合(去重) list1 = [6, 7, 7, 8, 8, 9] set(list1) # {6, 7, 8, 9} #两个列表转字典 list1 = ['key1','key2','key3'] list2 = ['] dict(zip(list1,list2)) # {'key1': '1', 'key2': '2', 'key3': '3'} #嵌套列表转字典 list3 = [['key1','value1'],['key2','value2'],['key3