Buscador de frases II

Crie uma função que retorne a frase que contém a palavra no índice n. Lembre-se de incluir o ponto final.

Exemplo resolvido

txt = "I have a dog. I have a log. There is no stopping me now."

sentence_searcher(txt, 7) ➞ "I have a log."
# The word at index 7 is "log".
# The full sentence that contains the word at index 7 is "I have a log."
# Return the sentence.

Exemplos

sentence_searcher(txt, 2) ➞ "I have a dog."

sentence_searcher(txt, 4) ➞ "I have a log."

sentence_searcher(txt, -1) ➞ "There is no stopping me now."
# The index at -1 is the last word.
# The last word is "now".

Notas

  • Todas as frases terminarão com um ponto final.
  • Você também precisa considerar índices negativos.