Complete the code to print a message automatically.
print([1])
The print function needs a string inside quotes to display text.
Complete the code to run a task every 5 seconds.
import time while True: print("Task running") time.[1](5)
The time.sleep(seconds) function pauses the program for the given seconds.
Fix the error in the code to automate a task without stopping.
count = 0 while count < 3: print("Running task", count) count [1] 1
The += operator adds 1 to count each loop to avoid an infinite loop.
Fill both blanks to create a dictionary of tasks that run only if active.
tasks = {task: status for task, status in [1] if status [2] True}Use tasks.items() to get pairs and is to check if status is True.
Fill all three blanks to filter and square numbers automatically.
result = [1]: [2]**2 for [3] in numbers if [2] % 2 == 0
Use the same variable num for key, value, and loop variable to square even numbers.
