Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. def c():
  2. y = "you"
  3. text = "Thank you for chatting with us. A rep will be with you shortly.
  4. You are currently number 1 in queue. "
  5. for i in text:
  6. for line in i:
  7. split_line = line.split()
  8. if y in split_line:
  9. index = split_line.index(y)
  10. print(' '.join(split_line[max(0, index - 2):min(index +3,len(split_line))]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement