
Recursion in Python Quiz
Quiz
•
Information Technology (IT)
•
9th Grade
•
Practice Problem
•
Easy
Fadi Fadi
Used 1+ times
FREE Resource
Enhance your content in a minute
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
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
Tes Perkembangan Revolusi Industri
Quiz
•
5th Grade - University
15 questions
Eval. 3B Bloque 1
Quiz
•
9th Grade - University
11 questions
Keyboard Shortcuts
Quiz
•
5th Grade - University
10 questions
grafh dan tree
Quiz
•
9th Grade
10 questions
Ôn tập HKI Công nghệ - Khối 4
Quiz
•
4th Grade - University
15 questions
Soal Informatika Kelas 9 BAB 3 Sistem Komputer - 01
Quiz
•
9th Grade
10 questions
Quiz Assesmen Awal "Perangkat Keras"
Quiz
•
7th Grade - University
10 questions
Informatika Kelas 9 Materi Algotirma dan Pemrograman
Quiz
•
9th Grade
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
Discover more resources for Information Technology (IT)
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
10 questions
Understanding Meiosis
Interactive video
•
6th - 10th Grade
15 questions
Meiosis vs mitosis
Quiz
•
9th Grade
10 questions
Exploring the Origins of Veterans Day
Interactive video
•
6th - 10th Grade
28 questions
Ser vs estar
Quiz
•
9th - 12th Grade
16 questions
Ethos, Pathos, Logos Practice
Quiz
•
9th Grade
15 questions
Two Step Equations
Quiz
•
9th Grade
