Loops-Quiz
Quiz
•
Professional Development
•
6th - 8th Grade
•
Practice Problem
•
Medium
harshit shukla
Used 3+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Q. 1 Which of the following is the correct syntax for a for loop in Python?
A) for x in range(10):
B) for (x=0; x < 10; x++):
C) for x to 10:
D) for x from 0 to 10:
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
2. What is the output of the following Python code?
for i in range(3):
print(i)
A) 1 2 3
B) 0 1 2
C) 0 1 2 3
D) Error
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
3. Which of the following statements about the while loop is true?
A) A while loop runs a
fixed number of times.
B) A while loop continues to
execute as long as its condition is True.
C) A while loop is
faster than a for loop.
D) A while loop executes at least once,
no matter the condition.
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
4. How many times will the following while loop execute?
i = 0
while i < 5:
i += 1
A) 4
B) 5
C) Infinite
D) 0
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Q.5. What is the output of the following code?
x = 0
while x < 3:
print(x)
x += 1
A) 0 1 2 3
B) 1 2 3
C) 0 1 2
D) Infinite loop
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Q.6. What will happen if the condition in a
while loop is always True and no break statement is present?
A) The loop will execute
a fixed number of times.
B) The loop will run indefinitely,
creating an infinite loop.
C) The loop will never execute.
D) The loop will execute only once.
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Q.7. What is the main difference
between a for loop and a while loop?
A) A for loop repeats based on a condition,
while a while loop repeats for a
specific number of iterations.
B) A for loop repeats for a specific number
of iterations, while a while loop repeats
based on a condition.
C) Both repeat for a specific
number of iterations.
D) Both repeat
based on a condition.
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
10 questions
Ladakh
Quiz
•
KG - Professional Dev...
10 questions
INVENTARIOS Y COMPRAS
Quiz
•
1st - 12th Grade
10 questions
MMA
Quiz
•
1st - 12th Grade
15 questions
Preguntas de si y no
Quiz
•
6th - 12th Grade
15 questions
Exportacion
Quiz
•
7th Grade
12 questions
Web Start
Quiz
•
1st - 10th Grade
10 questions
Perkalian 3
Quiz
•
2nd - 6th Grade
14 questions
Professionalism: Personal Management Skills
Quiz
•
8th - 12th 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 Professional Development
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
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
20 questions
Percent of a Number
Quiz
•
6th Grade
15 questions
scatter plots and trend lines
Quiz
•
8th Grade
20 questions
Physical and Chemical Changes
Quiz
•
8th Grade
20 questions
Photosynthesis and Cellular Respiration
Quiz
•
7th Grade
