0
0
Agentic_aiml~10 mins

Queue-based task processing in Agentic Ai - Interactive Code Practice

Choose your learning style8 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
Aremove
Bpop
Cappend
Dclear
Attempts:
3 left
2fill in blank
medium

Complete 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'
Aappend
Bpop
Cinsert
Dclear
Attempts:
3 left
3fill in blank
hard

Fix 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'
A>
B!=
C<
D==
Attempts:
3 left
4fill in blank
hard

Fill 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'
A.name
B>
C<
D_id
Attempts:
3 left
5fill in blank
hard

Fill 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'
A.id
B.status
C==
D.name
Attempts:
3 left