Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to split a big task into smaller steps using a list.
Agentic AI
steps = ["Understand problem", [1], "Test solution"]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing options that ignore or skip parts of the task.
✗ Incorrect
We split the big task into smaller parts to handle it easily.
2fill in blank
mediumComplete the code to create a function that runs each step in order.
Agentic AI
def run_steps(steps): for step in [1]: print(f"Doing: {step}")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using range instead of the list variable.
✗ Incorrect
We loop through the list of steps to run them one by one.
3fill in blank
hardFix the error in the code that tries to run steps but uses wrong variable name.
Agentic AI
def execute(steps): for s in [1]: print(f"Execute: {s}")
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name not defined in the function.
✗ Incorrect
The function parameter is named 'steps', so we must loop over 'steps'.
4fill in blank
hardFill both blanks to create a dictionary mapping step names to their order number.
Agentic AI
step_order = {step: [1] for [2], step in enumerate(steps)} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up step and index variable names.
✗ Incorrect
We use 'enumerate' to get index and step, then map step to index.
5fill in blank
hardFill all three blanks to filter steps that contain the word 'data' and count them.
Agentic AI
filtered = [step for step in steps if [1] in [2]] count = len([3])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong variable names or forgetting to count filtered list.
✗ Incorrect
We check if 'data' is in each step, collect those steps, then count them.