Append to array in Python

In Python, lists can be used as arrays, because the language doesn’t have built-in support. An array is one chunk of memory that usually consists of multiple elements, where a list is a list of objects where one element points to another and it doesn’t have to be inside one block of memory.

You can simulate an array by changing an element with the index number.

Result:

Append an element to an array

To add a new element to an array, use the append function.

Result: