Control Structures - boolean operators, conditional statements, loops for-while, break and continue - Online Test
30:00
1. Which keyword is used to start a conditional statement in Python?
2. What is the primary function of a `while` loop in Python?
3. Which of the following is NOT a boolean operator in Python?
4. What does the `break` statement do within a loop?
5. Which keyword is used to define a block of code that executes only if a preceding `if` condition is false?
6. What is the purpose of the `continue` statement in a Python loop?
7. Which loop is typically used when the number of iterations is known beforehand?
8. Consider the following code: `x = 5
if x > 10:
print('A')
else:
print('B')`. What will be printed?
9. The `for` loop in Python iterates over items in which of the following?
10. Which operator returns `True` if both operands are true, and `False` otherwise?
Test Results
0/0