Another interesting string method is
.find() takes a string as an argument and searching the string it was run on for that string. It then returns the first index value where that string is located.
Here’s an example:
print('smooth'.find('t')) # => '4'
We searched the string
'smooth' for the string
't' and found that it was at the fourth index spot, so
You can also search for larger strings, and
.find() will return the index value of the first character of that string.
print("smooth".find('oo')) # => '2'
Notice here that
2 is the index of the first o.