Get A Specific Word From A Sentence In Python
Code
string = "The quick brown fox jumps over the lazy dog."
target_word_index = 4
word = string.split(" ")[target_word_index]
print(word)
Results
jumps
string = "The quick brown fox jumps over the lazy dog."
target_word_index = 4
word = string.split(" ")[target_word_index]
print(word)
jumps