Skip to content

Instantly share code, notes, and snippets.

@kshirsagarsiddharth
Created July 31, 2020 12:22
Show Gist options
  • Select an option

  • Save kshirsagarsiddharth/6f876835b0e81a00907eeb58dcd5a946 to your computer and use it in GitHub Desktop.

Select an option

Save kshirsagarsiddharth/6f876835b0e81a00907eeb58dcd5a946 to your computer and use it in GitHub Desktop.
import random
def bad_service_chatbot():
answers = ["We don't do that",
"We will get back to you right away",
"Your call is very important to us",
"Sorry, my manager is unavailable"]
yield "Can I help you?"
s = ""
while True:
if s is None:
break
s = yield random.choice(answers)
g = bad_service_chatbot()
print(next(g))
print(g.send(""))
print(g.send(""))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment