例如:
set1 = {i**2 for i in range(1,4)} print(set1) list1 = [1, 1, 2] set2 = {i**2 for i in list1} print(set2)