Complete the code to stop the loop when the number 3 is found.
for num in range(5): if num == 3: [1] print(num)
The break statement stops the loop immediately when the condition is met.
Complete the code to skip printing the number 3 but continue the loop.
for num in range(5): if num == 3: [1] print(num)
The continue statement skips the current loop iteration and moves to the next one.
Fix the error in the code to correctly skip even numbers and print only odd numbers.
for num in range(1, 6): if num % 2 == 0: [1] print(num)
Using continue skips even numbers and prints only odd numbers.
Fill both blanks to create a dictionary of squares for numbers less than 5, skipping number 3.
squares = {x: x[1]2 for x in range(1, 7) if x [2] 5 and x != 3}Use ** for power and < to filter numbers less than 5.
Fill all three blanks to create a dictionary of uppercase keys and values greater than 2.
result = { [1]: [2] for k, v in data.items() if v [3] 2}Use k.upper() for uppercase keys, v for values, and > to filter values greater than 2.