← How-To Guides How-To How to find the index of an item in a list Use list.index(x). Use enumerate or a loop if you need to handle duplicates or a predicate. index index raises ValueError if not found. lst = ['a','b','c'] i = lst.index('b') # 1