Python check first and last index of a list -
Assume that the object is the list that contains the objects.
I want to see that my current move is on the first or last item for the object list
: if_something if first_indexed_element: do_something_else If last_commented_allement: do_another_thing
How can this be achieved? I know that I can use the category and counting index, but if it seems unnecessary.
Comments
Post a Comment