Want to create interactive content? It’s easy in Genially!
TANGRAM QUIZ
Ana Mellon
Created on August 22, 2023
Start designing with a free template
Discover more than 1500 professional designs like these:
View
Smart Quiz
View
Essential Quiz
View
Practical Quiz
View
Akihabara Quiz
View
Piñata Challenge
View
Math Calculations
View
Pixel Challenge
Transcript
Python Quiz
How much do you know about functions and procedures?
START
Question 1
What is a function in Python?
A sequence of code that performs a specific task
A loop structure
A way to define classes
A way to store data
Correct!
A function is a sequence of code that performs a specific task
NEXT
Question 2
How do you define a function in Python?
Using the `def` keyword
Using the `function` keyword
Using the `var` keyword
Using the `define` keyword
Correct!
'def' is the keyword to define functions and procedures
NEXT
Correct!
'def' is the keyword to define functions and procedures
NEXT
Question 3
What are parameters in a function?
Conditions for executing the function
Names of variables used in the function
The return values of the function
Numbers assigned to the function
Correct!
The function will return a value assigned to a variable
NEXT
Question 4
What does the `return` statement do in a function?
Defines a new variable
Terminates the function
Prints the output of the function
Sends a value back to the caller
Correct!
the value of the variable is returned for further use within the program
NEXT
Question 5
How would you call a function named `calculate_area` with two arguments, `length` and `width`?
`calculate_area(length, width)`
`calculate_area(width, length)`
`calculate_area(length = width)`
`calculate_area(width + length)`
Correct!
to avoid confusions always make sure the order of your arguments matches the order of your function parameters
NEXT
Question 6
What's the purpose of using functions in programming?
To add comments to the code
To make the code shorter
To organise and modularise code
To make the code run faster
Correct!
'Re-using code helps to reduce the scope for errors and makes it easier to maintain
NEXT
Question 4
What does the `return` statement do in a function?
Defines a new variable
Terminates the function
Prints the output of the function
Sends a value back to the caller
LEVEL COMPLETED!
START
Nope!
You have another chance
GO BACK
¡ERROR!