You are on page 1of 2

2IT702: Artificial Intelligence Practical-1

Practical-1

Aim : Write a python/Java program to implement simple Chatbot.

Code:
print(" chatbot ")
print("=================================================")
print("You can ask one of the questions from following list.")
print("1] Hii")
print("2] How are you?")
print("3] What is your name?")
print("4] What is your birthdate?")
print("5] What is you favourite food?")
print("6] exit")
while True:
ques=input("Write your question :")
ques=ques.lower()
if ques in [1,"hii","hi","hello"]:
print("Hello")
elif ques in [2,"how are you?"]:
print("I am fine")
elif ques in [3,"what is your name?","your name?"]:
print("My name is Devanshi")
elif ques in [4,"what is your birthdate?","your birthdate?"]:
print("My birthdate is 26-06-2000")
elif ques in [5,"what is your favourite food?","favourite food?","your favourite food?"]:
print("My favourite food is Pizza.")
elif ques in [6,"quit","exit"]:
break
else:
print("Please enter one of the question from above list")

Name:Devanshi Parejiya Page 1


Enrollment No.: 17012021005
2IT702: Artificial Intelligence Practical-1

OUTPUT:-

Name:Devanshi Parejiya Page 2


Enrollment No.: 17012021005

You might also like