How to insert elements into array without using append, Python?

PHOTO EMBED

Fri Oct 15 2021 08:13:02 GMT+0000 (Coordinated Universal Time)

Saved by @rainxx #python

>>> lis = []
>>> lis = lis + [1]
>>> lis
[1]
>>> lis = lis + [2]
>>> lis
[1, 2]
>>> lis += [3]  # += acts like list.extend, i.e changes the list in-place
>>> lis
[1, 2, 3]
content_copyCOPY

https://stackoverflow.com/questions/17137184/how-to-insert-elements-into-array-without-using-append-python