examples/lists/index.py
from __future__ import print_function

words = ['cat', 'dog', 'snake', 'camel']
print(words.index('snake'))

print(words.index('python'))
examples/lists/index.py.out
2
Traceback (most recent call last):
  File "examples/lists/index.py", line 6, in <module>
    print(words.index('python'))
ValueError: 'python' is not in list