Finding Substrings: find() and index() in Python


Locate substrings within a string.

Source Code

sentence = "Look over there!"
print(sentence.find("over"))
print(sentence.index("there"))
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments