wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

001

Total questions: 20

Worksheet time: 3mins

Name
Class
Date
1.

What does this code print?

print("Hello" + "World")

a)

Hello World

b)

HelloWorld

c)

"Hello" + "World"

2.

What will type(5.0) return?

a)

int

b)

float

c)

str

d)

bool

3.

What is the result of this code?

print(3 * "ha")

a)

hahaha

b)

3ha

c)

Error

4.

What does input() do in Python?

a)

It displays something on the screen.

b)

It calculates numbers.

c)

It receives user input.

5.

Which of these is a valid variable name?

a)

2cool

b)

my-name

c)

first_name

6.

What is the result of this code?

4 + 3 * 2

a)

14

b)

10

c)

7

d)

11

7.

What is the data type of "42"

a)

int

b)

str

c)

bool

d)

float

8.

Which operator checks if two values are equal?

a)

=

b)

==

c)

!=

9.

What does this code do?

10*2 == True

a)

True

b)

20

c)

Flase

10.

What will this print?

print(10 > 5)

a)

True

b)

10

c)

False

11.

What does len(["a", "b", "c"]) return?

a)

0

b)

3

c)

a b c

d)

abc

12.

What keyword is used to define a function in Python?

a)

function

b)

def

c)

DEF

13.

Which of these is a list?

a)

{1, 2, 3}

b)

[1, 2, 3]

c)

(1, 2, 3)

d)

"1, 2, 3"

14.

How can you display “3.14” using the math module?

a)

math.pi

b)

math.3,14

c)

math.value

15.

What will this print?

mylist = ["🥑" , "🍌" , "🍉" , "🥥"]

print(mylist [1] )

a)

🥑

b)

🍌

c)

1

16.

List, Set, and Dictionary: mutable

Tuple: Immutable

a)

Yes

b)

No

17.

What does this code print?

fruits = {"apple", "banana", "apple", "orange"}

print(fruits)

a)

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

b)

{'apple', 'banana', 'orange'}

c)

apple banana apple orange

18.

Which of these is a dictionary?

a)

{"name": "Sara", "age": 15}

b)

["name", "Sara", "age", 15]

c)

("name", "Sara")

19.

How do you access the second element in a list called items?

a)

items.2

b)

items[2]

c)

items(2)

d)

items[1]

20.

Which data structure is best for storing a group of unique values?

a)

List

b)

Dictionary

c)

Set

d)

Tuple