Given the list:
li = ['a', 'b', 'new', 'mpilgrim', 'z', 'example', 'new', 'two', 'elements']
How do I find the (first) index containing the string amp
? Note that amp
is contained the word example
.
FYI, this works: li.index("example")
But this does not: li.index("amp")