NANDHOO
.
Learning Paths
Dashboard
Sign In
Home
Dashboard
Python Programming: From Beginner to Production
Control Flow
Quiz
Chapter Quiz: Control Flow
Control Flow Quiz
Complete this assessment with 100% score to master this chapter.
01
What is the correct syntax for an 'if' statement in Python?
if x > 5 then:
if (x > 5) {
if x > 5:
if x > 5;
02
Which keyword is used to check another condition if the first 'if' was false?
else if
elseif
elif
otherwise
03
What does 'continue' do inside a loop?
Exits the loop completely
Skips the rest of the current iteration and moves to the next
Pauses the loop for 1 second
Restarts the loop from the beginning
04
What is the output of: list(range(2, 10, 3))?
[2, 3, 4, 5, 6, 7, 8, 9]
[2, 5, 8]
[2, 4, 6, 8]
[3, 6, 9]
05
When does the 'else' block on a 'for' loop run?
When the loop body raises an exception
When the loop condition is initially False
When the loop completes without hitting a 'break' statement
After every iteration of the loop
Submit Answers
Back to Lesson
Next Chapter