Want to create interactive content? It’s easy in Genially!

Get started free

TANGRAM QUIZ

Ana Mellon

Created on August 22, 2023

Start designing with a free template

Discover more than 1500 professional designs like these:

Transcript

START

How much do you know about functions and procedures?

Python Quiz

A way to store data

A way to define classes

A loop structure

Question 1

A sequence of code that performs a specific task

What is a function in Python?

NEXT

A function is a sequence of code that performs a specific task

Correct!

Using the `define` keyword

Using the `var` keyword

Using the `function` keyword

Using the `def` keyword

Question 2

How do you define a function in Python?

NEXT

'def' is the keyword to define functions and procedures

Correct!

NEXT

'def' is the keyword to define functions and procedures

Correct!

Numbers assigned to the function

The return values of the function

Names of variables used in the function

Conditions for executing the function

Question 3

What are parameters in a function?

NEXT

The function will return a value assigned to a variable

Correct!

Sends a value back to the caller

Prints the output of the function

Terminates the function

Defines a new variable

Question 4

What does the `return` statement do in a function?

NEXT

the value of the variable is returned for further use within the program

Correct!

`calculate_area(width + length)`

`calculate_area(length = width)`

`calculate_area(width, length)`

`calculate_area(length, width)`

Question 5

How would you call a function named `calculate_area` with two arguments, `length` and `width`?

NEXT

to avoid confusions always make sure the order of your arguments matches the order of your function parameters

Correct!

To organise and modularise code

To make the code run faster

To make the code shorter

To add comments to the code

Question 6

What's the purpose of using functions in programming?

NEXT

'Re-using code helps to reduce the scope for errors and makes it easier to maintain

Correct!

Sends a value back to the caller

Prints the output of the function

Terminates the function

Defines a new variable

Question 4

What does the `return` statement do in a function?

START

LEVEL COMPLETED!

GO BACK

You have another chance

Nope!

¡ERROR!