
Python Looping Unit Quiz
Authored by Tracy Hebert
9th - 12th Grade
Used 795+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
About
This quiz thoroughly assesses Python looping structures and control flow, making it appropriate for grades 9-12 students studying introductory computer science or programming. The questions focus on two primary loop types: for loops with the range() function and while loops with conditional statements. Students must demonstrate understanding of range() parameters including start, stop, and step values, predict loop output by tracing through iterations, analyze loop termination conditions, and understand control flow statements like break. The quiz requires students to read and interpret Python syntax, understand logical operators (and, or) in Boolean expressions, distinguish between inclusive and exclusive ranges, and recognize when infinite loops occur. Students need strong analytical skills to trace through code execution step-by-step and conceptual understanding of when to choose for loops versus while loops based on whether the number of iterations is predetermined or depends on runtime conditions. Created by Tracy Hebert, a teacher in the US who teaches grades 9-12. This comprehensive assessment serves multiple instructional purposes throughout a Python programming unit on loops and iteration. Teachers can use this quiz as a formative assessment to gauge student understanding before moving to more complex programming concepts, assign it as homework to reinforce classroom learning, or implement it as a review activity before summative assessments. The variety of question types - from syntax recognition to code tracing to conceptual understanding - makes it valuable for identifying specific areas where students need additional support. This quiz aligns with computer science standards including CSTA K-12 CS Standards 3A-AP-13 (creating prototypes using control structures) and 3A-AP-15 (justifying the selection of specific algorithms), as well as supporting state standards that emphasize algorithmic thinking and programming fundamentals in high school computer science courses.
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following for loops would print the following numbers?
for i in range(5):
print i
for i in range(1, 5, 1):
print i
for i in range(6):
print i
print i in range(0,5,1):
print i
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following for loops would print the following numbers?
for i in range(3,10,2):
print i
for i in range(3,9,2):
print i
for i in range(9):
print i
for i in range(3, 9)
print i
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the value of num when this loop completes?
2
8
12
20
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following for loops will give the same values for i as the loop below?
for i in range(10):
for i in range(11,0):
for i in range(10, 0, -1):
for i in range(0,10):
for i in range(0,11,1):
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Three of the for loops below will provide identical values for i. Which for loop will provide values that do not match the others?
for i in range(0,5):
for i in range(5):
for i in range(0,5,1):
for i in range(5,0,1):
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does this program print?
It's still a nice day
It's still a nice day
It's still a nice day
It's still a nice day
It's still a nice day
It's still a nice day
It's still a nice day
It's still a nice day
It's still a nice day
It's still a nice day
It's still a nice day
It's still a nice day
It's still a nice day
It's still a nice day
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following while loops would continue to loop as long as num has values in the range 3 to 12, exclusive?
while num >12 and num <3:
# do something with num
while num <12 or num <3:
# do something with num
while num <=12 and num >=3:
# do something with num
while num <12 and num >3:
# do something with num
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?