Bird
Raised Fist0
Agentic AIml~10 mins

Scaling agents horizontally 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 create multiple agents running in parallel.

Agentic AI
agents = [Agent() for _ in range([1])]
Drag options to blanks, or click blank then click option'
A1
B10
C5
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 agents means no agents run.
Using 1 agent does not scale horizontally.
2fill in blank
medium

Complete the code to start all agents asynchronously.

Agentic AI
results = await asyncio.gather(*[agent.[1]() for agent in agents])
Drag options to blanks, or click blank then click option'
Astart
Bstop
Crun
Dpause
Attempts:
3 left
💡 Hint
Common Mistakes
Using stop() or pause() will not start the agents.
Using run() might be valid but here the method is start().
3fill in blank
hard

Fix the error in the code to correctly collect agent outputs.

Agentic AI
outputs = [agent.[1]() for agent in agents]
results = await asyncio.gather(*outputs)
Drag options to blanks, or click blank then click option'
Arun_async
Bstart
Cexecute
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using synchronous methods causes errors with await.
Using run() or execute() may not be async.
4fill in blank
hard

Fill both blanks to create a dictionary of agent results filtered by success.

Agentic AI
success_results = {agent.id: result for agent, result in zip(agents, results) if result [1] [2]
Drag options to blanks, or click blank then click option'
A==
BTrue
CFalse
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using != False works but is less clear.
Using == False filters failures, not successes.
5fill in blank
hard

Fill all three blanks to aggregate agent outputs into a summary dictionary.

Agentic AI
summary = [1](agent.id: [2] for agent, [3] in zip(agents, results))
Drag options to blanks, or click blank then click option'
Adict
Bresult
Ditem
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same variable name for both zipped elements causes confusion.
Not using dict to convert the generator to a dictionary.