
u4- Loops in Python Quiz
Authored by Aram M
Education
2nd Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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
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
15 questions
Control de lectura #9
Quiz
•
1st Grade - University
10 questions
2n ELS ANIMALS (PREVI)
Quiz
•
2nd Grade
10 questions
Maen Pukul - PLBJ
Quiz
•
1st - 5th Grade
10 questions
MARCO TEÓRICO
Quiz
•
1st - 5th Grade
10 questions
Nyanyian : sebutan
Quiz
•
2nd Grade
12 questions
Ch.6 Les représentants du personnel
Quiz
•
1st - 3rd Grade
15 questions
MAIKLING PAGSUSULIT SA MTB 2
Quiz
•
2nd Grade
10 questions
Jogos eletrônicos
Quiz
•
1st - 5th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade