Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to start the first step in the sequence.
Agentic AI
result = agent.execute_step([1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start' or 'init' instead of the exact step name 'step_1'.
Forgetting to put the step name in quotes.
✗ Incorrect
The first step is named 'step_1' to begin the sequence.
2fill in blank
mediumComplete the code to check if the current step is finished.
Agentic AI
if agent.status == [1]: print('Step complete')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Checking for 'running' instead of 'finished'.
Using 'pending' which means not started yet.
✗ Incorrect
The status 'finished' means the current step is done.
3fill in blank
hardFix the error in the code to move to the next step.
Agentic AI
next_step = agent.get_next_step()
agent.execute_step([1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'agent.next_step' which is not defined.
Passing the method itself instead of its result.
✗ Incorrect
Use the variable 'next_step' returned by get_next_step() to execute the next step.
4fill in blank
hardFill both blanks to create a loop that runs all steps until done.
Agentic AI
while agent.status != [1]: current = agent.get_current_step() agent.execute_step([2])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Checking for 'running' instead of 'finished' in the loop condition.
Passing 'agent.status' instead of the current step to execute_step.
✗ Incorrect
The loop runs until status is 'finished'. Each step is executed using the current step variable.
5fill in blank
hardFill all three blanks to collect results from each step in a list.
Agentic AI
results = [] while agent.status != [1]: step = agent.get_current_step() output = agent.execute_step([2]) results.[3](output)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'extend' which expects an iterable, not a single output.
Passing wrong variable to execute_step.
✗ Incorrect
The loop runs until 'finished'. Each step is executed using 'step'. The output is added to results with 'append'.