how to find first and last index of in python code example
Example 1: how to take index first and last in python in one way
[some_list[0], some_list[-1]]
Example 2: indexing python first and last
l = [1,2,3,4,5]
l[::len(l)-1]
[some_list[0], some_list[-1]]
l = [1,2,3,4,5]
l[::len(l)-1]