Froggy Jumps Python While QuizVersion en ligne Test your knowledge about the Python while loop with this quiz game! par Андрей Бараболин 1 What is the purpose of the while loop in Python? a To repeatedly execute a block of code as long as a certain condition is true b To skip the execution of a block of code c To execute a block of code a specific number of times 2 Which keyword is used to define a while loop in Python? a for b while c do 3 What happens if the condition of a while loop is initially false? a The code inside the loop is executed once b The code inside the loop is never executed c The code inside the loop is executed indefinitely 4 How can you exit a while loop before its condition becomes false? a By using the break statement b By using the continue statement c By using the pass statement 5 What is the purpose of the continue statement in a while loop? a To skip the rest of the code inside the loop and start the next iteration b To exit the loop immediately c To repeat the code inside the loop indefinitely 6 What is an infinite loop? a A loop that executes a specific number of times b A loop that keeps executing without ever terminating c A loop that executes a block of code only once 7 What is the purpose of the else statement in a while loop? a To specify a block of code to be executed when the loop condition is true b To specify a block of code to be executed when the loop condition becomes false c To specify a block of code to be executed before each iteration 8 What is the difference between a while loop and a for loop? a A while loop can only iterate over a sequence, while a for loop can iterate over any iterable object b A while loop can only execute a block of code once, while a for loop can execute it multiple times c A while loop can continue indefinitely, while a for loop has a predetermined number of iterations 9 What is the purpose of the pass statement in a while loop? a To exit the loop immediately b To skip the rest of the code inside the loop and start the next iteration c To do nothing and act as a placeholder 10 What is the output of the following code? i = 0 while i < 5: print(i) i += 1 a 0 1 2 3 4 b 0 c 1 2 3 4 5