dimanche 26 octobre 2014

searching within string python iterables vs list iterables


Vote count:

0




Could someone explain why a search as follows


2,2,2,2 in range(20)


yields a result as (2, 2, 2, True)


and 5,4,3,19 in range(20)


yields a result as (5, 4, 3, True)


A search like "tab" in "batman" gives False whereas "bat" in "batman" is true. Likewise why is the order not preserved in the above searches. Also I'd like an explanation of the results it gives.



asked 22 secs ago







searching within string python iterables vs list iterables

Aucun commentaire:

Enregistrer un commentaire