Bird
Raised Fist0
Agentic AIml~10 mins

Tracing agent reasoning chains in Agentic AI - Interactive Code Practice

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

Complete the code to initialize the reasoning chain with an empty list.

Agentic AI
reasoning_chain = [1]
Drag options to blanks, or click blank then click option'
A[]
B{}
CNone
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using {} which creates an empty dictionary instead of a list.
Using None which is not a container.
Using 0 which is an integer, not a list.
2fill in blank
medium

Complete the code to add a new reasoning step to the chain.

Agentic AI
reasoning_chain.[1]('Step 1: Analyze input data')
Drag options to blanks, or click blank then click option'
Ainsert
Bappend
Cpop
Dremove
Attempts:
3 left
💡 Hint
Common Mistakes
Using remove or pop which delete items instead of adding.
Using insert without specifying an index.
3fill in blank
hard

Fix the error in the code to retrieve the last reasoning step.

Agentic AI
last_step = reasoning_chain[1]
Drag options to blanks, or click blank then click option'
A[-1]
B[0]
C[1]
D[-2]
Attempts:
3 left
💡 Hint
Common Mistakes
Using [0] which accesses the first item, not the last.
Using [1] or [-2] which do not reliably get the last step.
4fill in blank
hard

Fill both blanks to create a dictionary mapping step numbers to reasoning steps.

Agentic AI
step_dict = { [1]: reasoning_chain[[2]] for [1] in range(len(reasoning_chain)) }
Drag options to blanks, or click blank then click option'
Ai
Bj
Crange(len(reasoning_chain))
Ddict
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'j' instead of 'i' inconsistently.
Forgetting the outer curly braces for the dictionary comprehension.
Using range(len(reasoning_chain)) incorrectly inside the comprehension.
5fill in blank
hard

Fill all three blanks to filter reasoning steps containing the word 'data' and create a list of those steps.

Agentic AI
filtered_steps = [step for step in reasoning_chain if '[1]' in step.lower() and len(step) [2] int([3])]
Drag options to blanks, or click blank then click option'
Adata
B>
C10
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' which filters shorter steps.
Checking for 'Data' without lowercasing the step.
Using a number too small or too large for filtering.