Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
import random #Random function imported and used to return a random value from a selection
#dictionary created so random responses are given based on the users input
greetings = {"hello": ["Hey how are you?", "Whats up?", "Welcome"], "hey": ["Welcome", "How may i help you?"],
"sup": ["Wagwan bro", "Whats good?", "Welcome"]}
def respond(message):
if message in greetings:
response = random.choice(greetings[message])
#Prints a random greeting allocated with what the user input
#This is to provide viarety as well as cater to different users
print("Chatbot: " + response)
else:
print("Sorry i did not quite get that")
chat = input("You: ")
respond(chat)