Skip to main content

Simple AI ChatBot with Python

This is a simple basic code of my Sara AI brain written in Python, Just say Hi, and she will recognize it and respond appropriately.



The program consists of 2 parts:
1) [Arrays] of what user inputs to our chat bot.
2) ‎[Conditions] of responses that Chat bot will reply with.

So if you add more arrays with more conditions, Sara will be more smarter than now!

You can change her name as you like and feel free to teach her something new :)

The code:

#By DevHima
#List of greetings that the program will recognize as greetings
greetingdict = ["hello", "hi","what's up", "hola", "how are you?", "greetings", "salutations", "hey", "sup", "wussup", "Hello", "Hi","What's up", "Hola", "How are you?", "Greetings", "Salutations", "Hey", "Sup", "Wussup"]
#welcome message
print("Don't be shy, say hi!")
#read user input
x = input("You said: ")
print(x)
#check if user input is a greeting
if x in greetingdict:
print("Sara: Hi, pleased to meet you! My name is Sara.")
else:
print(" It's rude not to greet new people!")

Comments

Popular Posts

AI Snake Game

This is an A.I Snake game, written by me in Java script, the snake has a simple memory that is used to store its mistakes in the game to try to avoid later. Its artificial intelligence is still limited. It depends on the next cell checking that needs to move to without taking into consideration its length. So you will see it collides with itself!, so I'm working to develop it to make it more smarter. Here is the source code of the game for learning & developing: Download   Later, I'll publish some comments to explain the code ... Good luck :) Game Preview: *Click on [Play A.I] to start game AI Snake Game By Dev.Hima Score: 0 Play A.I Best Score: 0 ...

xCrypto 2.0

Secure your files with unbroken NTRU algorithm from quantum attacks. With xCrypto 2.0 you can use Public/Private Key NTRU algorithm to secure (Encrypt/Decrypt) your sensitive files on your android. NTRU is a cryptography algorithm based on lattice cryptography. NTRU is unbroken for now from Quantum Computing Attacks. You can download it from Google play store: