1. 元素去重 data = [1,2,3,4,4,5,5,6] res = set(data) 2. 元素去重排序 res = sorted(set(data)) 2. 打印重复的元素 res = [x for x in data if data.count(x) > 1] 3. 阶乘 num = 10 res = reduce(lambda x, y: x*y, range(num+1)[1:]) 6. 列表推导式 origin = ['a', 'b', 'c', 'z'] print [x…