wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python II Lesson 2

Total questions: 12

Worksheet time: 6mins

Name
Class
Date
1.

Which symbol is floor division?

a)

//

b)

/

c)

*

d)

)

2.

Which symbol represents multiplication?

a)

*

b)

/

c)

+

d)

**

3.

Which symbol is used for exponents?

a)

**

b)

-

c)

_

d)

//

4.

Which symbols surround a list?

a)

[]

b)

{}

c)

()

d)

||

5.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
6.
What will the output be from the following code?
print(3*4+5)
a)
27
b)
17
c)
12
d)
SyntaxError
7.

Which function changes a string to a float?

a)

float()

b)

num()

c)

print()

d)

change()

8.

A list is changeable and unordered

a)

True

b)

False

9.

List items have an index number. In the following list, which item has the index number of 3?

["John", "Harry", "Jesse", "John", "Harry", "Harry"]

a)

"John"

b)

"Harry"

c)

"Jesse"

d)

"John"

10.

The list needs one more name added to the end - "Felipe". Which piece of code below would do this?

nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]

a)

nameList.append(Felipe)

b)

append(nameList,"Felipe")

c)

nameList.append["Felipe",7]

d)

nameList.append("Felipe")

11.

What is the answer to?

print(10 % 4)

a)

1

b)

3

c)

2

d)

4

12.
What Python command lets the user enter an answer to a question?
a)
answer()
b)
open()
c)
print()
d)
input()