Skip to content

How to find last index of list in Python?

# To get the last element in a list you use -1 as position
bikes = ['trek', 'redline', 'giant']
# Output:
# 'giant'
See also  Python code snippet - How to delete a column in pandas dataframe?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.