wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

3.00

Total questions: 20

Worksheet time: 3mins

Name
Class
Date
1.

What will this code do?

print(7 // 2)

a)

3.5

b)

3

c)

4

2.

What is printed?

print("Hi" + "5")

a)

Hi5

b)

Hi+5

c)

5Hi

3.

What is printed?

print("Hi+5")

a)

Hi5

b)

Hi+5

c)

5Hi

4.

What will happen here?

print("Level " + str(5))

a)

Error

b)

Level + 5

c)

Level 5

5.

What is the length of this list?

["🍕", "🍔", "🍟", "🌮"]

a)

3

b)

4

c)

5

6.

What is the index of the last element in this list?

["🍕", "🍔", "🍟", "🌮"]

a)

3

b)

4

c)

5

7.

What is printed?

print(type(3.14))

(a)  

8.

What is printed?

print(type("3.14"))

(a)  

9.

What data structure uses keys and values?

a)

List

b)

Tuple

c)

Dictionary

d)

Set

10.

Which data structure is immutable?

(immutable = unchangeable)

(a)  

11.

What type is this?

True

a)

str

b)

bool

c)

int

d)

none of them

12.

What is the output here?

int(True)

a)

True

b)

1

c)

Error

13.

What does .append() do to a list?

a)

Deletes the last item

b)

Adds an item in the end

c)

Adds an item in a specific index

14.

What does math.sqrt(9) return?

a)

3

b)

81

c)

9

15.

Choose the correct syntax for a dictionary

a)

["apple": "red"]

b)

{"apple": "red"}

c)

("apple", "red")

d)

{"apple", "red"}

16.

What does this print?

print(3 in [1,4,5,8,6,2,3,7,5,9,6,8,4])

a)

True

b)

False

c)

3

d)

[3]

17.

What is the output here?

for number in range(5):

print(number)

(a)  

18.

What is the output here?

numbers = [1, 2, 3, 4, 5]

for number in numbers:

print(numbers)

a)

[1, 2, 3, 4, 5]

[1, 2, 3, 4, 5]

[1, 2, 3, 4, 5]

[1, 2, 3, 4, 5]

[1, 2, 3, 4, 5]

b)

1

2

3

4

5

19.

What does this print?

print("🐱" * 3)

a)

🐱🐱🐱

b)

🐱3

c)

"🐱" * 3

20.

What does this code do?

fruits = ['apple', 'banana', 'orange', 'apple']

fruits.remove('apple')

print(fruits)

a)

['banana', 'orange', 'apple']

b)

['banana', 'orange']