Complete the code to add a task to the queue.
task_queue.[1](new_task)To add a task to the queue, we use the append method which adds an item to the end of the list.
Complete the code to get the next task from the queue.
next_task = task_queue.[1](0)
To get and remove the first task from the queue, we use pop(0) which removes the item at index 0.
Fix the error in the code to check if the queue is empty.
if len(task_queue) [1] 0: print('Queue is empty')
To check if the queue is empty, we compare its length to zero using ==.
Fill both blanks to create a dictionary of task names and their priorities for tasks with priority higher than 5.
high_priority_tasks = {task[1]: task.priority for task in tasks if task.priority [2] 5}We access the task name with .name and filter tasks with priority greater than 5 using >.
Fill all three blanks to create a dictionary of task IDs and their statuses for tasks that are completed.
completed_tasks = {task[1]: task[2] for task in tasks if task.status [3] 'done'}The dictionary keys are task IDs accessed by .id, values are statuses accessed by .status, and we filter tasks where status equals 'done' using ==.
