Python Language Arrays Access individual elements through indexes


Example

Individual elements can be accessed through indexes. Python arrays are zero-indexed. Here is an example :

my_array = array('i', [1,2,3,4,5])
print(my_array[1])
# 2
print(my_array[2])
# 3
print(my_array[0])
# 1