wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

AP KT 2 Python Quiz

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What symbol is used for comments in Python?

a)

#

b)

//

c)

/*

d)

--

2.

Identify the error in the following line of code: `prinT ("welcome to the drinks menu")`

a)

The function name should be `print` instead of `prinT`

b)

The string should be enclosed in single quotes

c)

The parentheses are not needed

d)

The string should be in uppercase

3.

What is the correct Python symbol for the multiplication operator?

a)

x

b)

*

c)

/

d)

-

4.

Which of the following is NOT a comparison operator in Python?

a)

==

b)

!=

c)

<=

d)

%%

5.

Table showing comparison operators and their symbols

a)

+

b)

-

c)

*

d)

÷

6.

What is the correct Python symbol for division?

a)

÷

b)

x

c)

/

d)

-

7.

What is the purpose of comments in Python code?

a)

To execute a block of code

b)

To describe the code

c)

To create variables

d)

To perform calculations

8.

What is the error with this line of code?

print ("Hello" + Name)

a)

Capital N for name should be 'n'

b)

Capital H for hello should be 'h'

c)

Too many brackets

d)
  • is not needed

9.

What is the error with this line of code?

print("1-coke 2-fanta 3- sprite)

a)

missing end )

b)

Missing end "

c)

print should be capital P

10.

What is missing from this line of code?

print ("great choice" choice + "That is £2 please.")

a)

-

b)

=

c)

+

d)

))