s = {1, 2, 3} # 获取s中的每个元素 for a in s: print a # 依次打印1、2、3 # 复制到清单 l1 = list(s) # l1 = [1、2、3] # 使用列表理解 l2 = [a * 2 for a in s if a > 2] # l2 = [6]