Learning Scientific Programming with Python (2nd edition)
Q4.2.4: frozenset
Question Q4.2.4
If frozenset
objects are immutable, how is this possible:
>>> a = frozenset((1,2,3))
>>> a |= {2,3,4,5}
>>> print(a)
frozenset([1, 2, 3, 4, 5])
Learning Scientific Programming with Python (2nd edition)
If frozenset
objects are immutable, how is this possible:
>>> a = frozenset((1,2,3))
>>> a |= {2,3,4,5}
>>> print(a)
frozenset([1, 2, 3, 4, 5])