
u4- Loops in Python Quiz
Quiz
•
Education
•
2nd Grade
•
Medium
Aram M
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a "while loop" used for in Python?
To repeat a block of code a specific number of times
To repeat a block of code as long as a condition is true
To organise data in a list
To print text on the screen
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a "for loop" used for in Python?
To repeat a block of code a specific number of times
To check if a number is even or odd
To add two numbers together
To draw shapes on the screen
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correct example of a "while loop" in Python?
`while x < 5: print(x)`
`for x in range(5): print(x)`
`if x < 5: print(x)`
`print(x) while x < 5`
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correct example of a "for loop" in Python?
`for x in range(5): print(x)`
`while x < 5: print(x)`
`if x < 5: print(x)`
`print(x) for x in range(5)`
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code print? ```python for i in range(3): print("Hello") ```
Hello
Hello Hello
Hello Hello Hello
Nothing
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code do? ```python x = 0 while x < 3: print(x) x += 1 ```
Print 0, 1, 2
Print 1, 2, 3
Print 0, 1, 2, 3
Print 3, 2, 1
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In a "while loop", what does the condition do?
It decides how many times the loop will run
It checks if the loop should continue running
It prints the loop's output
It adds numbers together
Create a free account and access millions of resources
Similar Resources on Wayground
11 questions
variable
Quiz
•
KG - 5th Grade
6 questions
CTI Module 1 Week 5 Recap
Quiz
•
1st - 2nd Grade
10 questions
Poetry Game
Quiz
•
1st Grade - University
8 questions
Củng cố kiến thức
Quiz
•
1st - 5th Grade
13 questions
Python Siruri de caractere 1
Quiz
•
1st - 5th Grade
10 questions
9 Steps to Resolve Conflicts
Quiz
•
2nd Grade
14 questions
Fault Finding
Quiz
•
1st - 12th Grade
8 questions
Кіріктірілген функциялар
Quiz
•
1st Grade - University
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
Appointment Passes Review
Quiz
•
6th - 8th 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
20 questions
Grammar Review
Quiz
•
6th - 9th Grade
Discover more resources for Education
20 questions
addition
Quiz
•
1st - 3rd Grade
20 questions
Subject and predicate in sentences
Quiz
•
1st - 3rd Grade
20 questions
Addition and Subtraction facts
Quiz
•
1st - 3rd Grade
20 questions
Proper and Common nouns
Quiz
•
2nd - 5th Grade
15 questions
Multiplication Facts (2,5,10)
Quiz
•
2nd - 3rd Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
20 questions
nouns verbs adjectives test
Quiz
•
2nd Grade
20 questions
Sentence or Fragment?
Quiz
•
2nd - 5th Grade
