Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Below is an example - but you can create your own. Be sure to #comment the introductionary section. Should your chatbot have a name or a personality?
This is Eliza - the very first chatbot
While this is just an example - it does have a plan psuedocoded for you. Make sure to do comments to identify this section
Go crazy and add some oneline ascii art to your chatbot or use ++,==,--, or other symbols to drawn lines on the screen to seperate different parts of your user experience.
So if we ask a user to enter a number - the comptuer store that value as a STRING - and we cannot do math with Strings.
So how can we tell the computer that we want the value to be an integer?
Each print()
command does two things: displays a value to the user AND moves the cursor down to the next line
However - we can modifiy the end of our print command
Explain the output that you can see.
So what does , end =
do??
So far we have been joining strings using the +,
but for a print statement we can display more than one piece of data without having to join.
Consider this output from the visualizer
We are no longing combining strings to create a new string - we are displaying different data types and commands to the user by connecting pieces with a ,
Typically, we we ask the user to enter data - we will store that value in a variable
Notice that the user can see the question and their response on the console AND that the value stored in name defaults to a string
Your first major project will be a chatbot - you will simulate a converstation with a user by collecting information and building responses. Because this is a Unit 1 assignment there will not be any error checking - we will assume the user enters the correct information when prompted.
In codingrooms - open the assignment and make sure you are working on the chatBot.py file!
Use your math coding skills to guess the users age
Notice this is nicely psuedocoded out for you - and there are awesome examples of HOW to comment - go crazy and follow the directions.
Right now - our chatbot doesn't have any options on what to respond. But - could you had some pauses, or some other output phrases that indicate "thinking"
Can you insert a knock knock joke?
Can you make your chatbot overly friendly? rude? nosy?
Create a custom goodbye that
One component of AI is the attempt to replicate human emotion. So we want to include emotions in the conversation - but your chatbot does not have the ability to make a learned response based on the users input so you have to be generic.
Pick two topics and continue your conversation. Below is a sample conversation about animals - you may NOT use animals as one of your topics - but I wanted to give you an example