li = ['random values', True]
li[:] = 'some text'
If I print this out, the list becomes
['s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't']
.
Why does this happen?
li = ['random values', True]
li[:] = 'some text'
If I print this out, the list becomes
['s', 'o', 'm', 'e', ' ', 't', 'e', 'x', 't']
.
Why does this happen?