2 ms·
I can see why you might think so, but remember the Zen of Python is to have only one obvious way to do something. >>> [1,2,3] + [4,5] [1, 2, 3, 4, 5]
by msellout 12y ago
I can see why you might think so, but remember the Zen of Python is to have only one obvious way to do something.
>>> [1,2,3] + [4,5]
[1, 2, 3, 4, 5]
Thus appending should do something different than addition.
>>> x = [1,2,3]
>>> x.append([4,5])
>>> x
[1, 2, 3, [4, 5]]