, . Python .
Python ( 3) ( ), ( 255, .. ), ( ) ( ). ; , , () .
a
- (.. ), a[0]
, a[1]
.. ( ), mutable. (, , ), .
lst[0] = 3
, , print(s[3])
.
For lists and tuples, items are not stored directly inside the array. Only references to targets are stored internally. The object-object gets access indirectly (one jump on the link). Think that you are going to an indexed house, and the person inside tells you where the real content is (in another house, not on this street). In this case, even an element from the (immutable) set, for example, t[5]
i.e. link - can be used to modify the contents of the target ... if the target is modified.
source
share