# Examples for string find() in Python

#### Soham1087

##### Newbie
I (beginner) am trying to find some examples but no luck.

Does anyone know of some examples on the net? I would like to know what it returns when it can't find, and how to specify from start to end, which I guess is going to be 0, -1.

From Scaler I got the following resolution, but still unsure about it. Need your valuable insights on it.

Python:
>>> x = "Hello World"
>>> x.find('World')
6
>>> x.find('Aloha');
-1

#### KlausST

##### Super Moderator
Staff member
Hi,

">=0" means the position in the string, beginning with 0

H --> pos 0
e --> pos 1
l --> pos 2
l --> pos 3
o --> pos 4
[ ] --> pos 5
W --> pos 6
o --> pos 7
...

Klaus

#### Aussie Susan

Go to the source: https://docs.python.org/3/library/stdtypes.html
Search the page for 'find' and that is the definitive answer.
Of course you also need to understand slices if you want to use the optional parameters - but that is another story.
Susan