Question: what is the difference between index and find in python?
Answer: The index() method is similar to find() method for strings. The only difference is that find() method returns -1 if the substring is not found, whereas index() throws an exception.