# python declare array of size n

```>>> n = 5                     #length of list
>>> list = [None] * n         #populate list, length n with n entries "None"
>>> print(list)
[None, None, None, None, None]

>>> list.append(1)            #append 1 to right side of list
>>> list = list[-n:]          #redefine list as the last n elements of list
>>> print(list)
[None, None, None, None, 1]

>>> list.append(1)            #append 1 to right side of list
>>> list = list[-n:]          #redefine list as the last n elements of list
>>> print(list)
[None, None, None, 1, 1]

>>> list.append(1)            #append 1 to right side of list
>>> list = list[-n:]          #redefine list as the last n elements of list
>>> print(list)
[None, None, 1, 1, 1]
```

Here is what the above code is Doing:
1. Create a list of length n, with n entries of “None”
2. Append 1 to the right side of the list
3. Redefine the list as the last n elements of the list
4. Repeat steps 2 and 3 until the list is full of 1’s

The above code is equivalent to:

list = [1, 1, 1, 1, 1]