Skip to content

How to get location of word in list in Python?

l = ['a','b','c']
print(l.index('b'))
----------------------------------
>1
See also  Python code snippet - django How to avoid cors issue?

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.