Searching Lists : List Index « List « Python






Searching Lists

Searching Lists

li = ['a', 'b', 'new', 'D', 'z', 'example', 'new', 'two', 'elements'] 

print li.index("example")                                

print li.index("new")                                    

print li.index("z")                                      

print "c" in li                                         

           
       








Related examples in the same category

1.List index(x)List index(x)