Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to initialize a real-world agent with a task description.
Agentic AI
agent = RealWorldAgent(task_description=[1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a number instead of a string
Passing None instead of a description
✗ Incorrect
The task_description should be a string describing the agent's task, such as "Schedule meetings".
2fill in blank
mediumComplete the code to make the agent perform its task and return the result.
Agentic AI
result = agent.[1]() Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using initialize instead of execute
Using stop which ends the agent
✗ Incorrect
The method to perform the agent's task is usually called execute or run; here, execute is correct.
3fill in blank
hardFix the error in the code to correctly check if the agent completed the task.
Agentic AI
if agent.status == [1]: print("Task completed")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using True instead of 'completed'
Using 'done' which is incorrect
✗ Incorrect
The agent's status is a string 'completed' when the task is done, so the check must be against "completed".
4fill in blank
hardFill both blanks to create a dictionary of task results where keys are task names and values are their statuses.
Agentic AI
task_results = {task: agent.[1](task) for task in tasks if agent.[2](task)} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using run_task instead of get_status
Using stop_task instead of is_active
✗ Incorrect
get_status(task) returns the status, and is_active(task) checks if the task is active.
5fill in blank
hardFill all three blanks to filter tasks with priority above 5 and create a summary dictionary with task names and priorities.
Agentic AI
summary = {task[1]: agent.get_priority([2]) for task in tasks if agent.get_priority(task) [3] 5} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using .upper() instead of .lower()
Using < instead of > in filter
✗ Incorrect
task.lower() is used for the key, task for the get_priority argument, and the filter uses > 5.