python get first elements of list code example
Example 1: get first element of array python
some_array[0]
Example 2: how to get first element of array in python
arr = ["cat", "dog", "rabbit"]
first_element = arr[0]
Example 3: python get first n elements of list
l = [1, 2, 3, 4, 5]
print(l[:3])