
Introduction to Python - Loops and Logic
Authored by Khadeeja Haji
Computers
1st - 6th Grade
10 Questions
Used 15+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many numbers does this code output?
x = 0
while x < 8:
print(x)
x +=1
The numbers from 0 to 7
The numbers from 0 to 8
The numbers from 1 to 8
The numbers from 1 to 7
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many stars does this code output?
for i in range(5):
print("*")
1
2
4
5
3.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What is missing in this code for it to work properly?
x=0
while x < 5:
print(x)
x + 1
x += 1
x
+1
4.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which line makes this an infinite loop?
x = 6
while True:
print(x)
if x == 4:
break
x+=1
x+=1
break
while True
x == 4
Answer explanation
A while loop runs as long as the condition it has is true, in this case True can never be false, so the line that makes it INFINITE (it runs forever) is:
while True
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What type of loop is a for loop?
a conditional loop
a counter controlled loop
a variable
a number
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What type of loop is a while loop?
a counter controlled loop
a variable
a letter
a conditional loop
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many numbers will this loop print?
for i in range(1,7):
print(i)
Numbers 1 to 6
Numbers 0 to 7
Numbers 1 to 7
Numbers 1 to 8
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
EVALUACION TERCER PERIODO INFORMATICA FSA
Quiz
•
6th Grade
10 questions
Animation 1
Quiz
•
6th Grade
15 questions
THQT_Khoi7_Chude1_L2
Quiz
•
6th - 8th Grade
10 questions
Introdução aos Sistemas Operacionais
Quiz
•
1st Grade
10 questions
Cyber Security
Quiz
•
1st - 10th Grade
12 questions
Recapitulation ICT Quiz
Quiz
•
1st Grade
14 questions
BÀI 14- THUẬT TOÁN TÌM KIẾM TUẦN TỰ
Quiz
•
6th Grade - University
10 questions
Ôn lại Paint 5
Quiz
•
1st - 5th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade