W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
demo_python_ref_frozenset.py:
mylist = ['apple', 'banana', 'cherry'] x = frozenset(mylist) x[1] = "strawberry" print(x)
[email protected]
:/home/python#python demo_python_ref_frozenset.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