There are two string methods for this, find() and index() . The difference between the two is what happens when the search string isn't ... ... <看更多>
Search
Search
There are two string methods for this, find() and index() . The difference between the two is what happens when the search string isn't ... ... <看更多>
word[42] # the word only has 6 characters Traceback (most recent call last): File "<stdin>", line 1, in <module> IndexError: string index out of range. ... <看更多>
The index string method returns a value error where the find string method returns -1 if the argument is not ... ... <看更多>