# 如果你需要一个不可变的集合(例如作为字典的键),可以使用 frozenset fs = frozenset([1,2,3,4,5,6]) B = {1, 2, 3, 4} print(fs) print(len(fs))