
Subprograms quiz
Authored by Robert Daniel
Information Technology (IT)
7th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a function in programming?
A type of variable
A block of code designed to perform a particular task
A type of loop
A syntax error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correct way to define a function in Python?
`function myFunction()`
`def myFunction():`
`create myFunction()`
`define myFunction()`
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are parameters in a function?
The name of the function
The values returned by the function
The variables listed inside the parentheses in the function definition
The comments in the function
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is an argument in the context of functions?
A debate between two programmers
The actual value passed to the function
The name of the function
The return type of the function
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a recursive function?
A function that calls itself
A function that never stops running
A function that only runs once
A function that is defined outside of a class
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is an example of a recursive function?
A function that prints "Hello, World!" once
A function that calculates the factorial of a number by calling itself
A function that adds two numbers
A function that sorts a list
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the base case in a recursive function?
The first line of the function
The condition under which the function stops calling itself
The last line of the function
The name of the function
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?