Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to add a task to the queue.
Agentic_ai
task_queue.[1](new_task) Drag options to blanks, or click blank then click option'
Attempts:
3 left
2fill in blank
mediumComplete the code to get the next task from the queue.
Agentic_ai
next_task = task_queue.[1](0)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
3fill in blank
hardFix the error in the code to check if the queue is empty.
Agentic_ai
if len(task_queue) [1] 0: print('Queue is empty')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
4fill in blank
hardFill both blanks to create a dictionary of task names and their priorities for tasks with priority higher than 5.
Agentic_ai
high_priority_tasks = {task[1]: task.priority for task in tasks if task.priority [2] 5} Drag options to blanks, or click blank then click option'
Attempts:
3 left
5fill in blank
hardFill all three blanks to create a dictionary of task IDs and their statuses for tasks that are completed.
Agentic_ai
completed_tasks = {task[1]: task[2] for task in tasks if task.status [3] 'done'} Drag options to blanks, or click blank then click option'
Attempts:
3 left
