new files
This commit is contained in:
parent
3af7344581
commit
86c034bb8b
1364 changed files with 21352 additions and 0 deletions
9
Task/Search-a-list/Python/search-a-list-2.py
Normal file
9
Task/Search-a-list/Python/search-a-list-2.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
>>> 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
|
||||
>>>
|
||||
Loading…
Add table
Add a link
Reference in a new issue