Created
December 21, 2017 13:01
-
-
Save infrony/9f68c8ea8699b1093a27f82392a4a534 to your computer and use it in GitHub Desktop.
Simple Chatbot with python
This file contains 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 | |
greetings = ['hola', 'hello', 'hi', 'Hi', 'hey!','hey'] | |
random_greeting = random.choice(greetings) | |
question = ['Cómo estas?','Como estas?'] | |
responses = ['Gracias',"Estoy Bien"] | |
random_response = random.choice(responses) | |
while True: | |
userInput = input("Ingrese un saludo o una pregunta del arreglo:") | |
if userInput in greetings: | |
print(random_greeting) | |
elif userInput in question: | |
print(random_response) | |
else: | |
print("No entiendo lo que me estas pidiendo") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment