For Loop in Python
Quiz
•
Computers
•
11th Grade
•
Practice Problem
•
Hard
Nirender Prakash Singh
Used 39+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the syntax of a for loop in Python?
for item in iterable: # code to be executed
for i in range(n): # code to be executed
for element in list: # code to be executed
for item in iterable: # code to be executed
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you define the range of a for loop in Python?
By using the range() function with start, stop, and step parameters.
By using the len() function with the iterable as the parameter.
By using the start, stop, and step parameters directly in the for loop.
By using the range() function with only the stop parameter.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the else statement in a for loop?
To specify a block of code to be executed before the loop starts
To specify a block of code to be executed if the loop completes normally
To specify a block of code to be executed if the loop does not complete normally
To specify a block of code to be executed after each iteration of the loop
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many times does a for loop iterate if the range is (1, 5)?
4
2
1
3
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
0 1 2 Loop completed
0 1 2
3
0
1
2
0 1 2
3
Loop completed
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? for i in range(1, 6, 2): print(i)
1 2 3 4 5
1 2 3 4
1 3 5
1 3 5 7
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? for i in range(5, 0, -1): print(i)
1
2
3
4
5
1
2
3
4
5
4
3
2
1
4
3
2
1
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
Scratch (28th March)
Quiz
•
KG - University
10 questions
Hari 3 - Kuis Coding & Perkenalan AI
Quiz
•
8th Grade - University
10 questions
Initial Assessment - Cybersecurity Awareness
Quiz
•
9th Grade - Professio...
10 questions
R082 Book Cover Assets planning
Quiz
•
7th - 12th Grade
10 questions
DTJSQuiz
Quiz
•
11th Grade
10 questions
ID Quiz
Quiz
•
11th Grade
10 questions
Latency and Bandwidth
Quiz
•
10th - 11th Grade
15 questions
Internet Safety Quiz
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 Computers
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
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
10 questions
Los mandatos y las recetas
Lesson
•
11th Grade
7 questions
Anti-Bullying ARS 15-341
Quiz
•
9th - 12th Grade
13 questions
Model Exponential Growth and Decay Scenarios
Quiz
•
9th - 12th Grade
15 questions
TSI Math Practice Questions
Quiz
•
8th - 12th Grade
