1.列表list去重 l1 = [1,1,2,3,5,5,4,4,4,5,6] set1 = set(l1) # print(set1) # set是集合 l2 = list(set1) # 将集合转换成列表 print(l2) #[1, 2, 3, 4, 5, 6] 2.字典的创建3种方式 # (1)直接创建 dic1 = {'name':'alex','age':28,'sex':'M'} # (2)fromkeys()创建 dic = dict.fromkeys([1,2,3],'alex…