NEW
Font size
WorksheetsPython Chatbot - MCQs
Total questions: 15
Worksheet time: 8mins
What is the purpose of the import random statement in the code?
To sort a list randomly
To generate random numbers
To allow the program to choose a random joke
To make the chatbot smarter
What does the chatbot do first when it starts?
Tells a joke
Asks for your favorite color
Asks for your name
Greets the user with "Hello"
Which Python function is used to get input from the user?
input()
get()
print()
read()
How does the chatbot exit the conversation?
When you press Esc
When you type "exit"
When you say "stop"
When you type "bye"
What happens if the user types "how are you"?
The chatbot ignores it
It crashes
It responds with "I am fine."
It ends the chat
Which keyword is used to run code repeatedly?
if
elif
repeat
while
What will the chatbot do if it sees the word "joke"?
Tell a random joke
Ask a riddle
Say "No jokes today"
End the program
Which of the following is not a condition checked in the code?
"how are you"
"your name"
"weather"
"favorite color"
What does .lower() do in this program?
Converts the output to lowercase
Makes the chatbot speak softly
Converts the input to lowercase
Makes the program faster
What is stored in the variable jokes?
A string
A list of jokes
A random number
A user question
How does the chatbot choose which joke to tell?
It picks the first one
It asks the user to choose
It uses random.choice()
It rotates in order
What will the chatbot print if it doesn't understand the question?
"I don't understand."
"Try again later."
"Hmm, I don't have an answer for that. Try asking something else!"
It stays silent
What type of loop is used in this chatbot?
For loop
Do-while loop
While True loop
Repeat until loop
What is the main purpose of this chatbot program?
To perform calculations
To teach math
To have a simple conversation and tell jokes
To predict the weather
What does the break keyword do in this chatbot?
Pauses the program
Ends the chat loop
Clears the screen
Skips to the next joke
