Created
December 12, 2019 00:56
-
-
Save colinpollock/77efd3613eada997e28feb37ea696f6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sentence = 'Reggie Miller grew up in Riverside before going to UCLA.' | |
phrase = 'Riverside' | |
start_index = sentence.find(phrase) | |
end_index = start_index + len(phrase) | |
sentence[start_index-10:end_index+10] | |
# 'rew up in Riverside before go' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment