Created
July 31, 2020 12:22
-
-
Save kshirsagarsiddharth/6f876835b0e81a00907eeb58dcd5a946 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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