python get array size code example
Example 1: python declare array of size n
>>> n = 5
>>> list = [None] * n
>>> print(list)
[None, None, None, None, None]
>>> list.append(1)
>>> list = list[-n:]
>>> print(list)
[None, None, None, None, 1]
>>> list.append(1)
>>> list = list[-n:]
>>> print(list)
[None, None, None, 1, 1]
>>> list.append(1)
>>> list = list[-n:]
>>> print(list)
[None, None, 1, 1, 1]
Example 2: size array python
size = len(myList)
Example 3: python get array length
a = arr.array(‘d’, [1.1, 2.1, 3.1])
len(a)
Example 4: find array length in python
a=arr.array('d', [1.1 , 2.1 ,3.1] )
len(a)