Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

T-Level DPDD: Functions & Procedures Quiz

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Which of the following is NOT a type of function in Python?

a)

Built-in functions

b)

User-defined functions

c)

Anonymous functions

d)

Static functions

2.

What keyword is used to define a function in Python?

a)

func

b)

def

c)

function

d)

create

3.

What is the output of the example Python function call?

a)

This is my simple function

b)

This is a simple function

c)

This is my function

d)

This is a function

4.

What is an argument in the context of Python functions?

a)

The name of the function

b)

The value sent to the function when it is called

c)

The keyword used to define the function

d)

The output of the function

5.

Which of the following statements is true about methods and functions in Python?

a)

All functions are methods, but not all methods are functions.

b)

All methods are functions, but not all functions are methods.

c)

Methods and functions are the same.

d)

Methods cannot be called using an instance of a class.

6.

What is the output of the following Python function call? my_simple_function("Saundra")

a)

Saundra best friend

b)

Saundra good friend

c)

Saundra friend

d)

Saundra best buddy

7.

In Python, how do you separate multiple arguments in a function call?

a)

With a semicolon

b)

With a colon

c)

With a comma

d)

With a period

8.

What is the output of the following Python function call? my_function("Touffouo", "Mahnou")

a)

Touffouo Mahnou

b)

Mahnou Touffouo

c)

Touffouo, Mahnou

d)

Mahnou, Touffouo

9.

What will the example code print if temp is 25?

a)

25 turn thermostat up to 20°C

b)

25 turn thermostat down to 20°C

c)

temperature is 20°C

d)

25 turn thermostat off

10.

What will the example code print if temp is 18?

a)

18 turn thermostat up to 20°C

b)

18 turn thermostat down to 20°C

c)

temperature is 20°C

d)

18 turn thermostat off