Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to initialize a workflow orchestrator with a list of agents.
Agentic AI
orchestrator = WorkflowOrchestrator(agents=[1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing agents as a single string instead of a list.
Using curly braces which create a set, not a list.
✗ Incorrect
The agents parameter expects a list of agent names, so a list literal with strings is correct.
2fill in blank
mediumComplete the code to add a task to the orchestrator's workflow.
Agentic AI
orchestrator.add_task([1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing task name without quotes causing a NameError.
Passing a list or set instead of a string.
✗ Incorrect
The add_task method expects the task name as a string, so it must be quoted.
3fill in blank
hardFix the error in the code to execute the workflow and get results.
Agentic AI
results = orchestrator.[1]() Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run()' which is not defined in the orchestrator.
Using 'start()' or 'launch()' which are invalid method names.
✗ Incorrect
The correct method to start the workflow execution is 'execute()'.
4fill in blank
hardFill both blanks to create a dictionary mapping agent names to their statuses.
Agentic AI
status_map = [1]: [2] for [1] in agents
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same variable name for key and value without function call.
Using undefined variables like 'status' or 'agent_status'.
✗ Incorrect
We use 'agent' as the loop variable and call 'get_status(agent)' to get each agent's status.
5fill in blank
hardFill all three blanks to filter tasks that are completed and create a list of their names.
Agentic AI
completed_tasks = [task[1] for task in tasks if task.status [2] 'completed' and task.priority [3] 1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' instead of '==' for status check.
Using wrong comparison operators for priority.
Forgetting to access the task name with '.name'.
✗ Incorrect
We access task.name, check if status equals 'completed', and priority less or equal to 1.