I don't quite get this "string".find()

David Fraser davidf at sjsoft.com
Thu Nov 11 15:48:19 EST 2004


Jaime Wyant wrote:
> Will someone explain this to me?
> 
> 
>>>>"test".find("")
> 
> 0
> 
> Why is the empty string found at position 0?
> 

It's found there because it is there!

At any position, you can find an empty string because it is so short...

David



More information about the Python-list mailing list