Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def c():
- y = "you"
- text = "Thank you for chatting with us. A rep will be with you shortly.
- You are currently number 1 in queue. "
- for i in text:
- for line in i:
- split_line = line.split()
- if y in split_line:
- index = split_line.index(y)
- print(' '.join(split_line[max(0, index - 2):min(index +3,len(split_line))]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement