
KP4-Loops

Quiz
•
Arts
•
2nd Grade
•
Hard
MrsT Voci
Used 5+ times
FREE Resource
12 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
What would be the lowest value printed by this code?
for i in range(12):
print(i)
12
0
None of these
1
2.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
What is the value of the variable 'a' after it passes through the loops?
a = 0
for i in range(2):
for j in range(4):
a += i * j
10
4
6
8
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
What is the value of the variable 'a' after it passes through the loops?
a = 0
for i in range(2):
for j in range(3):
a += i + j
8
9
10
3
4.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
***Add the line of code needed to accumulate the total of all values of a and then print the result.
total=0
for a in range(6):
#what goes here?
print(total)
total = total +a
total = a +1
total += a
total =+a
5.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
****You are given a function which contains a non working while loop. The function also accepts a positive integer (x). The while loop is in an infinite loop state, which would be unwise to run. The while loop continually decreases the value variable by 1. Your task is to fix the code so that the loop exits and returns the value variable when it is equal to x.
def while_loop_finisher:
value = -1
while value:
value -=1
if value == x:
return x
break
if value == 1:
return value
break
if value = x:
return x
break
if x == value:
return x
break
6.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
What is the purpose of the break statement in Python?
Skip the remainder of the if body and transfer control to the if condition
Terminate the loop and transfer control to the statement following the loop
Skip the remainder of the loop body and transfer control to the loop condition
Terminate the if statement and transfer control to the statement following the if
7.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
What does the “continue” Statement in Python do?
it terminates the execution of statements while iterating the loop
it breaks the loop
None of these
it does not break the loop
Create a free account and access millions of resources
Similar Resources on Wayground
14 questions
Welcome to Music!

Quiz
•
2nd - 3rd Grade
11 questions
ARTE 1º TRIMESTRE 2º EP

Quiz
•
2nd Grade
15 questions
Arts

Quiz
•
2nd Grade
10 questions
Amplification du son

Quiz
•
KG - 9th Grade
10 questions
Kelab Diabolo

Quiz
•
2nd - 9th Grade
9 questions
The voice classification

Quiz
•
KG - 8th Grade
17 questions
Romantismo e Realismo

Quiz
•
2nd Grade
10 questions
Chess Club 2021 Quiz

Quiz
•
1st - 5th Grade
Popular Resources on Wayground
55 questions
CHS Student Handbook 25-26

Quiz
•
9th Grade
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
10 questions
Chaffey

Quiz
•
9th - 12th Grade
15 questions
PRIDE

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
22 questions
6-8 Digital Citizenship Review

Quiz
•
6th - 8th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
Discover more resources for Arts
10 questions
PBIS Terrace View

Quiz
•
1st - 5th Grade
20 questions
Addition and Subtraction

Quiz
•
2nd Grade
20 questions
Subject and predicate in sentences

Quiz
•
1st - 3rd Grade
20 questions
Addition and Subtraction facts

Quiz
•
1st - 3rd Grade
17 questions
Even and Odd Numbers

Quiz
•
2nd Grade
9 questions
Good Citizenship and Responsibility

Interactive video
•
1st - 3rd Grade
20 questions
Number Words Challenge

Quiz
•
1st - 5th Grade
12 questions
Place Value

Quiz
•
2nd Grade