1>>> myString = 'Position of a character'
2>>> myString.find('s')
32
4>>> myString.find('x')
5-1
1my_var = 'mummy'. #Find the position of 'm'
2
3#Using find - find returns the index for the first instance from the left.
4my_var.find('m')
5# Output: 0
6
7#Using rfind - rfind returns the index for the first instance from the right.
8my_var.rfind('m')
9# Output: 3
10# With find() and rfind(), when substring is not found, it returns -1.
11
12#NB: You can use index() and rindex(). In this case, when the substring is not
13# found, it raises an exception.