Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to initialize a personal assistant agent with a name.
Agentic AI
assistant = PersonalAssistant(name=[1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put quotes around the name.
Passing a variable instead of a string.
✗ Incorrect
The name parameter must be a string, so it needs quotes around it.
2fill in blank
mediumComplete the code to add a task to the assistant's task list.
Agentic AI
assistant.tasks.[1]("Schedule meeting at 3 PM")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using remove or pop which delete items instead of adding.
Using clear which empties the list.
✗ Incorrect
To add a new task, we use the append method on the tasks list.
3fill in blank
hardFix the error in the code to check if the assistant is available.
Agentic AI
if assistant.[1](): print("Assistant is ready")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using camelCase instead of snake_case.
Using a property name instead of a method.
✗ Incorrect
The correct method to check availability is is_ready(), following Python naming conventions.
4fill in blank
hardFill both blanks to create a dictionary of tasks with their priorities.
Agentic AI
task_dict = {task[1]: priority[2] tasks} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'if' instead of 'for' in the comprehension.
Using '==' instead of 'in' to loop.
✗ Incorrect
The correct syntax for dictionary comprehension is {key: value for key, value in iterable}.
5fill in blank
hardFill all three blanks to filter tasks with priority above 2 and create a list of their names.
Agentic AI
high_priority_tasks = [task[1] for task, priority [2] tasks if priority [3] 2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' instead of '>' for filtering.
Forgetting to access the task's name with .name.
✗ Incorrect
We access the task name with .name, loop with 'in', and filter with '>' for priority above 2.
