this is the python chatbot

This is the place to post any code that you want to share with the community. Only completed scripts should be posted here.
Note: posts here are not necessarily endorsed by the community, and may represent amateur or even bad practices.

this is the python chatbot

Postby nice coder » Sat Jan 16, 2016 12:47 am

Here is the python chatbot i pieced together from a script and information i saw on the internet.I hope you enjoy it.

Code: Select all
print  ("Hello, how are you?") 
print("Ask me ten question and then press enter")
"Type the questions in lower or uppercase with a question mark.")
number_guesses = 10   
= 'your name?'
father ='fathers name?'
food = 'like to eat?' 
= 'inches in a foot?'
like = 'like cold weather?'
best = 'restaurant around here?'
nerve = 'nerve the most?'  
= 'you like dogs?'
end = 'have to go'
cuss = 'Dammit'
number_left = number_guesses
= None
while x 
!= this and number_left:
    x = input("Type your word: ") 

    if this in x
("My name is bill.")
    elif father in x:
      print("His name is benton.")
    elif food in x:
      print("I love lasagna.")
    elif foot in x:
      print("There are 12 inches in a foot.")
    elif like in x:
      print("I really enjoy snow.So i would say yes.")
    elif best in x:
      print("The best restaurant around here is simon's.They have great hot fish and chips.")
    elif nerve in x:
      print("I really don't like it when people cuss around me.")
    elif dog in x:
      print("No, i don't like dogs.I was bit bad on the leg by one.")
    elif end in x:
      print("I will talk to you later.Have a nice afternoon.")
    elif cuss in x
      print("I dont like it when people cuss.So i will stop talking to you.")
     number_left -= 1
("I do not understand.You have %d number left." % number_left) :)
Last edited by micseydel on Sat Jan 16, 2016 12:57 am, edited 1 time in total.
Reason: Code tags. Initial post lock.
nice coder
Posts: 6
Joined: Sat Jan 16, 2016 12:19 am

Re: this is the python chatbot

Postby Loophole_ » Mon Jun 20, 2016 12:29 pm

its really :D
Posts: 29
Joined: Tue May 24, 2016 4:58 pm

Return to Completed Scripts

Who is online

Users browsing this forum: No registered users and 3 guests