demo_ref_frozenset2.py:
mylist = ['apple', 'banana', 'cherry'] x = frozenset(mylist) x[1] = "strawberry" print(x)
C:\Users\My Name>python demo_frozenset2.py
Traceback (most recent call last):
File "demo_ref_frozenset2.py", line 3, in <module>
x[1] = "strawberry"
TypeError: 'frozenset' object does not support item assignment