
Python Functions
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Hard
Knight Brandon
FREE Resource
Enhance your content in a minute
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a function in Python?
A function in Python is a type of data structure
A function in Python is a block of organized, reusable code that is used to perform a single, related action.
A function in Python is used to display text on the screen
A function in Python is a keyword used to define a variable
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are parameters in a function?
Parameters in a function are the variables that are used to store the output values of the function.
Parameters in a function are the variables that are used to receive input values when the function is called.
Parameters in a function are the data types used to declare the function.
Parameters in a function are the comments added to explain the purpose of the function.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are arguments in a function?
Arguments in a function are the names of the function
Arguments in a function are the comments within the function
Arguments in a function are the values that are passed to the function when it is called.
Arguments in a function are the values that are returned by the function
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the return statement in a function?
To declare a new variable
To print a message to the console
To specify the value that the function should return to the caller.
To stop the execution of the function
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you call a function in Python?
By using the function name followed by square brackets
By using the function name followed by brackets
By using the function name followed by parentheses
By using the function name followed by curly braces
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is recursion in Python?
Recursion in Python is a way to create random numbers in a program
Recursion in Python is a type of loop that iterates through a list of elements
Recursion in Python is a programming technique where a function calls itself to solve a problem.
Recursion in Python is a method for importing external libraries into a program
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Give an example of a recursive function in Python.
def factorial(n): if n == 0: return 1 else: return n * factorial(n-1)
def sum_list(arr): if len(arr) == 1: return arr[0] else: return arr[0] + sum_list(arr[1:])
def power(base, exp): if exp == 0: return 1 else: return base * power(base, exp-1)
def fibonacci(n): if n <= 1: return n else: return(fibonacci(n-1) + fibonacci(n-2))
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?
Similar Resources on Wayground
10 questions
ICT as Platform for Change
Quiz
•
11th - 12th Grade
10 questions
emtech
Quiz
•
12th Grade
10 questions
Visual Basic 2010
Quiz
•
8th Grade - University
12 questions
1.2.4. Types of Programming Language
Quiz
•
12th Grade
11 questions
Types of Mass Media
Quiz
•
10th Grade - Professi...
10 questions
UH Bab 3 XII 3
Quiz
•
12th Grade
11 questions
Test evaluation word SP3S1
Quiz
•
12th Grade
8 questions
Basic computer
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
