
Recursion in Python Quiz
Authored by Fadi Fadi
Information Technology (IT)
9th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
14 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is recursion in Python?
A way to create loops using for
A function that returns a list
A function that calls itself
A function that runs forever
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main danger of recursion if not written properly?
It prints the wrong result
It runs only once
It causes an infinite loop
It turns into a list
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which part of a recursive function stops it from calling itself forever?
Return statement
Loop
Base case
Recursive call
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will this function return? def factorial(n): if n == 1: return 1 else: return n * factorial(n - 1) print(factorial(3))
3
6
9
Error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the base case in this function? def countdown(n): if n == 0: print("Blast off!") else: print(n) countdown(n - 1)
print(n)
n == 0
countdown(n - 1)
"Blast off!"
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is printed when this code runs? def test(x): if x == 0: return print(x) test(x - 1) test(3)
3 2 1 0
0 1 2 3
3 2 1
Nothing
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these problems is most suitable for recursion?
Printing numbers from 1 to 10
Finding maximum in a list
Searching a file in nested folders
Adding two numbers
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
7 класс программирование
Quiz
•
7th Grade - University
10 questions
МЦКО
Quiz
•
8th Grade - University
13 questions
2GT-I1 - Internet
Quiz
•
9th Grade
13 questions
Aktivitas Informatika 1
Quiz
•
9th - 12th Grade
13 questions
Εντολή Όσο εισαγωγή
Quiz
•
9th - 12th Grade
15 questions
Lista no Scratch 9°ano
Quiz
•
9th Grade
10 questions
Continue операторы
Quiz
•
9th - 12th Grade
15 questions
Բուլյան տրամաբանություն
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
8 questions
2 Step Word Problems
Quiz
•
KG - University
20 questions
Comparing Fractions
Quiz
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Latin Bases claus(clois,clos, clud, clus) and ped
Quiz
•
6th - 8th Grade
22 questions
fractions
Quiz
•
3rd Grade
7 questions
The Story of Books
Quiz
•
6th - 8th Grade
Discover more resources for Information Technology (IT)
8 questions
2 Step Word Problems
Quiz
•
KG - University
10 questions
Martin Luther King, Jr. For Kids
Interactive video
•
1st - 12th Grade
10 questions
Dr. King's Speech and Its Impact
Interactive video
•
7th - 12th Grade
20 questions
El Verbo IR Practice
Quiz
•
9th Grade
10 questions
Understanding Meiosis
Interactive video
•
6th - 10th Grade
20 questions
Graphing Inequalities on a Number Line
Quiz
•
6th - 9th Grade
7 questions
Anti-Bullying ARS 15-341
Quiz
•
9th - 12th Grade
10 questions
Capitalize Countries and Places Quiz
Quiz
•
9th Grade