python search first occurrence in string

s = "the dude is a cool dude"
s.find('dude') # returns 4 - the first index of the first match in the string

Here is what the above code is Doing:
1. We create a string variable called s.
2. We call the find() method on the string variable s.
3. We pass the string ‘dude’ as an argument to the find() method.
4. The find() method returns the index of the first match of the string ‘dude’ in the string variable s.