get first element python code example
Example 1: get first element of array python
some_array[0]
Example 2: find the first element in phython list
Alist = ['Sun','Mon','Tue','Wed','Thu']
print("The given list : ",Alist)
print("The first element of the list : ",Alist[0])
print("The last element of the list : ",Alist[-1])
Example 3: how to take index first and last in python in one way
[some_list[0], some_list[-1]]