Skip to content

Python code snippet – How to find the position in a list ?

lst = [4, 6, 5]
lst.index(6) # will return 1
See also  How to sort dataframe in Python by length of groups?

Leave a Reply

Your email address will not be published. Required fields are marked *

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