Question
[PYTHON] Create a chatbot program in Python: a program that appears to talk intelligently to a human using text. Your program should involve asking the
[PYTHON] Create a chatbot program in Python: a program that appears to talk intelligently to a human using text. Your program should involve asking the user questions and having the computer respond in a reasonably intelligent fashion based on those answers. For example, here is a sample chat:
ChatBot: Welcome, I am Chatbot . What is your name?
User: My name is Abby .
ChatBot: Hello Abby. How old are you?
User: 22. <---- Input
ChatBot: That is older than I am! Can you guess my age?
User: 11. <----- Input
Chatbot: That is incorrect. My age is between 5 and 10. Guess again.
User: 4. <----- Input
Chatbot: Correct! What is your favourite animal?
User: Cat. <------ Input
Chatbot: I do not like cats. I prefer dogs.
etc.
You may make your chatbot ask and answer any questions, so long as you include at least the following:
- One if/else statement.
- One if statement using OR.
- One if statement using AND.
- One if statement using both AND and OR.
- At least one loop.
- At least one calculation involving a numerical answer that the user inputted (for example, in the above chat, the chatbot might calculate the difference between its age and the users age and output this).
The input only has to be one word or numbers, doesn't have to be a phrase.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started