Python splice assignment notation

  python, python-3.x
sentence = 'hello'
result = []
result[:] = sentence
print(result)//['h', 'e', 'l', 'l', 'o']

Python is so magical I don’t understand line 3, what’s happening under the hood.

Source: Python-3x Questions

LEAVE A COMMENT