wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Algo Mystery school level round 2

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

What is the data type of the value 10 in Python?

a)

int

b)

string

c)

boolean

d)

float

2.

Which of the following is a valid string in Python?

a)

"hello"

b)

"hello world"

c)

'world'

d)

'12345'

3.

How do you read input from the user in Python?

a)

Use the 'input()' function to read user input.

b)

Employ the 'fetch()' command to retrieve user data.

c)

Utilize the 'scan()' method for input collection.

d)

Use the 'read()' function to get user input.

4.

What is the output of print(type(3.14)) in Python?

a)

b)

c)

d)

5.

Which data structure is used to store multiple items in a single variable in Python?

a)

Array, Queue, Stack, Graph

b)

Matrix, Tree, Heap, LinkedList

c)

List, Tuple, Set, Dictionary

d)

String, File, Object, Module

6.

What is the correct way to create a list in Python?

a)

my_list = '1, 2, 3'

b)

my_list = [1, 2, 3]

c)

my_list = {1, 2, 3}

d)

my_list = (1, 2, 3)

7.

How do you access the first element of a list named 'myList' in Python?

a)

myList.get(1)

b)

myList.first()

c)

myList[0]

d)

myList[-1]

8.

What is the output of print('Hello' + ' World') in Python?

a)

Hello, World!

b)

Hello World

c)

Hello World

d)

HelloWorld

9.

Which of the following is a mutable data type in Python?

a)

list

b)

tuple

c)

set

d)

dictionary

10.

How do you convert a string to an integer in Python?

a)

float('string')

b)

int('string')

c)

eval('string')

d)

str('string')

11.

What is the default return value of a function in Python if no return statement is used?

a)

False

b)

Undefined

c)

Null

d)

None

12.

Which keyword is used to define a function in Python?

a)

method

b)

function

c)

define

d)

def

13.

What is the output of print(len([1, 2, 3])) in Python?

a)

5

b)

2

c)

4

d)

3

14.

How do you create a dictionary in Python?

a)

A dictionary in Python can be created using {} or the dict() constructor.

b)

A dictionary in Python can be created using [] or the list() constructor.

c)

You can create a dictionary in Python by using () or the tuple() function.

d)

A dictionary in Python is made with <> or the set() method.

15.

What is the purpose of the input() function in Python?

a)

The purpose of the input() function in Python is to read user input as a string.

b)

The input() function retrieves data from a file.

c)

The input() function converts strings to integers.

d)

The input() function outputs data to the console.

16.

What keyword is used to define a function in Python?

a)

define

b)

def

c)

func

d)

function

17.

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

a)

finally

b)

try

c)

catch

d)

except

18.

What is the output of print(type(3.14)) in Python?

a)

boolean

b)

string

c)

float

d)

int

19.

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

a)

finally

b)

try

c)

catch

d)

except

20.

What is the purpose of the 'return' statement in a function?

a)

To exit the function

b)

To print a value

c)

To send a value back to the caller

d)

To define a function