10 lines
302 B
Python
10 lines
302 B
Python
>>> haystack=["Zig","Zag","Wally","Ronald","Bush","Krusty","Charlie","Bush","Bozo"]
|
|
>>> haystack.index('Bush')
|
|
4
|
|
>>> haystack.index('Washington')
|
|
Traceback (most recent call last):
|
|
File "<pyshell#95>", line 1, in <module>
|
|
haystack.index('Washington')
|
|
ValueError: list.index(x): x not in list
|
|
>>>
|