wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python!

Total questions: 11

Worksheet time: 3mins

Name
Class
Date
1.

How do you ask a person what their understanding is in Python?

a)

print()

b)

what()

c)

input

d)

input()

2.

Which of the following is used to create a function in Python?

a)

def

b)

function

c)

create

d)

func

3.

How do you start a comment in Python?

a)

//

b)

/*

c)

#

d)

--

4.

Which of the following is a correct variable name in Python?

a)

1variable

b)

variable_1

c)

variable-1

d)

variable.1

5.

Which of the following is used to import a module in Python?

a)

import

b)

include

c)

require

d)

load

6.

How do you create a list in Python?

a)

[]

b)

{}

c)

()

d)

<>

7.

Which of the following is used to handle exceptions in Python?

a)

try

b)

catch

c)

handle

d)

except

8.

How do you assing a variable in Python?

(a)  

9.

Which of the following is used to create a dictionary in Python?

a)

[]

b)

{}

c)

()

d)

<>

10.

How do you create a tuple in Python?

a)

[]

b)

{}

c)

()

d)

<>

11.

Which of the following is used to check if a key exists in a dictionary in Python?

a)

in

b)

exists

c)

has_key

d)

contains