Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete 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'
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.
✗ Incorrect
The reasoning chain should start as an empty list to store steps sequentially.
2fill in blank
mediumComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using remove or pop which delete items instead of adding.
Using insert without specifying an index.
✗ Incorrect
The append method adds a new item to the end of the list, which is suitable for adding reasoning steps.
3fill in blank
hardFix 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'
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.
✗ Incorrect
Using [-1] accesses the last item in the list, which is the most recent reasoning step.
4fill in blank
hardFill 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'
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.
✗ Incorrect
We use dict comprehension with 'i' as the index variable to map step numbers to steps.
5fill in blank
hardFill 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'
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.
✗ Incorrect
We check if 'data' is in the step (case-insensitive) and filter steps longer than 10 characters.
