For Loop Quiz

Quiz
•
Computers
•
11th Grade
•
Hard

Michael Alves
Used 1+ times
FREE Resource
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the for loop allow us to do?
Execute code an indefinite number of times
Execute code based on user input
Execute code a predetermined number of times
Execute code only once
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the starting value of the variable 'i' in a for this loop:
for i in range(5):
1
-1
0
2
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the range function determine in a for loop?
The number of times the loop runs
The conditions for the loop to end
The number of variables used in the loop
The type of data used in the loop
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code: for i in range(4): print(i+1)?
1 2 3 4
0 1 2 3
2 3 4 5
4 3 2 1
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the value of 'i' when the loop ends in the code: for i in range(6)?
5
6
4
7
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code: for i in range(3): print('hello')?
hello
hello hello hello
hello hello hello hello
hello hello
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code: for i in range(3): print(i)?
0 1 2 3
1 2 3 4
1 2 3
0 1 2
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens if you change the number in range to 8 in the code: for i in range(8)?
The loop will run 6 times
The loop will run 9 times
The loop will run 8 times
The loop will run 7 times
Similar Resources on Wayground
12 questions
Hour of Code

Quiz
•
6th - 12th Grade
12 questions
Python Loops

Quiz
•
9th - 11th Grade
10 questions
10 CS // Pseudocode

Quiz
•
9th - 11th Grade
10 questions
Pseudocode - OCR ERL

Quiz
•
9th - 12th Grade
12 questions
Code Tracing Quiz

Quiz
•
9th - 12th Grade
12 questions
Python Gr 12

Quiz
•
11th - 12th Grade
10 questions
Programming Basics Basics

Quiz
•
8th Grade - University
9 questions
Unit 5 -- Lists, Loops, Traversals

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade