Control Flow: if & Loops — Chapter Test

Answer all 5 questions, then submit. You need 60% to pass. Log in to save progress.

Question 1
In Python, what defines a block of code (e.g. the body of an if)?
ACurly braces { }
BIndentation
CSemicolons
DThe word 'block'
Question 2
What sequence does range(1, 6) produce?
A1, 2, 3, 4, 5, 6
B1, 2, 3, 4, 5
C0, 1, 2, 3, 4, 5
D1 to 6 including 6
Question 3
Which statement immediately exits a loop?
Acontinue
Bbreak
Cstop
Dexit
Question 4
What does continue do inside a loop?
AEnds the loop
BSkips the rest of the current iteration and moves to the next
CRestarts the program
DPauses the loop
Question 5
Which loop is best when you do NOT know in advance how many times to repeat?
Afor loop
Bwhile loop
Crange loop
Dif loop