
Python Loops Quiz
Quiz
•
Computers
•
9th Grade
•
Practice Problem
•
Hard
Alexandra Solomon
Used 1+ times
FREE Resource
Enhance your content in a minute
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet? ```python for i in range(5): print(i) ```
0 1 2 3 4 5
0 1 2 3 4
1 2 3 4 5
Error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is used to exit a loop prematurely?
pass
continue
break
exit
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the `continue` statement do in a loop?
Exits the loop
Skips the rest of the code inside the loop for the current iteration
Pauses the loop
None of the above
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many times does the following loop run? ```python for i in range(2, 10, 2): print(i) ```
3
4
5
6
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet? ```python i = 5 while i > 0: i -= 1 if i == 2: break print(i) ```
4 3 2 1 0
4 3 2
4 3
5 4 3 2 1
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which loop is best when the number of iterations is known?
for loop
while loop
do-while loop
Infinite loop
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet? ```python x = 0 while x < 4: x += 1 if x == 2: continue print(x) ```
1 2 3 4
1 3 4
2 3 4
1 2 3
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
Already have an account?
Similar Resources on Wayground
16 questions
Hour_of_Code
Quiz
•
5th - 12th Grade
10 questions
Pojęcia informatyczne
Quiz
•
1st - 10th Grade
17 questions
FormazioneSicurezzaSpecifica_Mod. 3.1
Quiz
•
9th - 12th Grade
10 questions
Diagnoses and Identification of Faulty Computer and Network
Quiz
•
9th Grade
20 questions
SOFTWARE 7I
Quiz
•
7th Grade - University
16 questions
ETİK BİLGİ VE SİBER SUÇLAR
Quiz
•
1st - 12th Grade
10 questions
8° / 9° Pensamento Computacional
Quiz
•
9th Grade
11 questions
Računalne mreže
Quiz
•
3rd - 10th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
15 questions
4:3 Model Multiplication of Decimals by Whole Numbers
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
The Best Christmas Pageant Ever Chapters 1 & 2
Quiz
•
4th Grade
12 questions
Unit 4 Review Day
Quiz
•
3rd Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
