wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

chatbot python

Total questions: 20

Worksheet time: 3600secs

Name
Class
Date
1.

Which keyword is used to define a function in Python?

a)

define

b)

function

c)

def

d)

execute

2.

What is the purpose of variables in Python?

a)

Store values

b)

Execute tasks

c)

Make decisions

d)

Create dictionaries

3.

What is the purpose of a dictionary in Python?

a)

Make decisions

b)

Create key-value pairs

c)

Store values

d)

Execute tasks

4.

What is the keyword used to create an infinite loop in Python?

a)

for

b)

break

c)

while True

d)

if

5.

Which of the following statements will assign the value 5 to the variable Z in Python?

a)

z < 5

b)

Z - 5

c)

Z = 5

d)

Z==5

6.

Which Python keyword is used to check multiple conditional statements?

a)

if

b)

elif

c)

else

d)

for

7.

output of this code

a)

1

b)

5

c)

6

d)

any one of the value

8.

A ____________chatbot is trained to perform a specific task

a)

Emotional

b)
Task-oriented
c)

Rule based

d)
Random
9.

A ______ is used to store information

a)

variable

b)

input

c)

string

d)

output

10.

To exit a ______ loop the condition must be false.

a)

for

b)

while

c)

gaint

d)

in

11.

Correct Syntax for define List.

a)

[ ]

b)

{ }

c)

( )

d)

" "

12.

What are the values written in list are called?

a)

Element

b)

Data

c)

Code

d)

Entry

13.

how to write random Choice

a)

random.choice

b)

random.choise

c)

choice.random

d)

random.random

14.

Which function takes input from a user?

a)

input

b)

import

c)

print

d)

variable

15.

complete the following code:

if "popular place " in variable:

______("Rishikesh")

a)

print

b)

input

c)

def

16.

Which statement checks the condition of user input

a)

if -elif- else

b)

elif

c)

while

d)

break

17.

What will be the output of following code?

Exam = 3+4

print("Exam")

a)

Exam

b)

3+4

c)

7

18.

what is a loop?

a)

which repeat the code

b)

input the user values

c)

system in ai

d)

Ai based chatbot

19.

if you want to print 2 element of this list what should you code?

x = [ 1,2,3,4,5,6]

a)

print[x]

b)

print(x[0])

c)

print[1]

d)

print(x[1])

20.

what is a python

a)

snake

b)

code

c)

language

d)

program