Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What is the output of for i in range(3): print(i)?
The range starts at 0 by default.
What condition must be true for a while loop to continue running?
Think about what check is done in the loop.
Which of the following statements about a 'for' loop is true?
Think about the main purpose of a for loop.
True or False: A while loop will stop running as soon as the condition is false.
Consider how condition checking works in loops.
Write a function that prints the Fibonacci sequence up to n using a while loop.
Consider initializing two variables and update them in the loop.
Use a for loop to generate multiplication tables for numbers 1 to 5.
Think about nesting loops—one for the numbers and another for the multipliers.
5 more questions in this section. Enroll free to practise them all.
Enroll free