Y12: Functions and Procedures -Retrieval
Quiz by Teran Subasinghe
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Measure skills
from any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
With a free account, teachers can
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
9 questions
Show answers
- Q1Which of the following best describes a procedure in programming?A set of instructions that perform a specific task.A way to input data into a program.A method for displaying output.A variable that stores data.30s
- Q2In programming, what is the main difference between a function and a procedure?A function cannot have parameters, while a procedure can.A function returns a value, while a procedure does not.Functions are only used for mathematical calculations.A procedure is always faster than a function.30s
- Q3Which of the following statements is true about functions in programming?Functions can only be defined once in a program.Functions can be called multiple times with different arguments.A function call will always execute at least twice.Functions do not accept parameters.30s
- Q4What is the purpose of parameters in a function?To define the output type of the function.To store the function's internal variables.To allow the function to accept input values.To limit the number of times a function can be called.30s
- Q5What will happen if you call a function that is not defined?It will return null.It will ignore the call.It will execute a default function.It will throw an error.30s
- Q6What is the effect of the 'return' statement in a function?It pauses the execution of the script.It declares a new variable in the function.It exits the function and provides a value to the caller.It repeats the function call.30s
- Q7What is the correct way to define a function in Python?create my_function{}:function my_function():define my_function[]:def my_function():30s
- Q8Which of the following describes a parameter in Python functions?A return value from the function.The name of the function itself.A variable that is defined in the function's parentheses and can be used within the function.A global variable that affects all functions.30s
- Q9What will happen if a function is called without the required parameters?The function will execute but return None.A TypeError will be raised.The function will execute with default values.The program will crash immediately.30s