H466 - Recursion in Python
Quiz
•
Computers
•
8th Grade
•
Practice Problem
•
Medium
R Eveleigh
Used 3+ times
FREE Resource
Enhance your content in a minute
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a base case in recursion?
A condition that causes the function to call itself
A condition that stops the recursion
A condition that multiplies the result
A condition that adds more parameters
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a characteristic of a recursive function in Python?
It uses a loop to iterate over a sequence
It calls itself with a modified argument
It always returns a list
It never returns a value
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How does recursion differ from iteration?
Recursion uses loops, while iteration uses function calls
Recursion is always faster than iteration
Recursion uses function calls, while iteration uses loops
Recursion and iteration are the same
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following recursive function in Python: ```python def factorial(n): if n == 0: return 1 else: return n * factorial(n-1) ``` What is the base case for this function?
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is an advantage of using recursion over iteration?
Recursion is easier to understand for problems that have a natural recursive structure
Recursion always uses less memory than iteration
Recursion is always faster than iteration
Recursion never causes stack overflow
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
Python - Operators and Conditional Statement
Quiz
•
3rd - 10th Grade
10 questions
Python Inputs
Quiz
•
7th - 8th Grade
10 questions
General Computing
Quiz
•
5th - 12th Grade
10 questions
QBASIC Programming
Quiz
•
5th - 10th Grade
10 questions
OCR GCSE CS 1.2 Memory MCQ
Quiz
•
7th - 11th Grade
10 questions
tin 8 bài 4
Quiz
•
6th - 9th Grade
10 questions
Quiz: PlayBoard y C++
Quiz
•
8th Grade
10 questions
DBMS Quiz 3
Quiz
•
1st - 10th 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
