The Case. Real AI agents have tools β a calculator, a search, a weather app β and the clever part is choosing the right one for the job.
Your tools. Plain Python gives the agent three tools and a rule for deciding which one each goal needs.
Investigate. Press Run. For each goal the agent announces which tool it picked and the answer it got.
- Choosing the right tool for a task is exactly what assistants like modern AI agents do.
- Add your own goal at the bottom and see which tool it reaches for.
your_code.py
Starting Pythonβ¦
The Reveal
Starting Pythonβ¦ (first time only β a few seconds)
ποΈ Detective's notes
Bundles your findings, chart and code into one PDF you can keep, print or hand in.
π§© How this code works
How to read it, top to bottom
- 1. Import β bring in the tools (listed above).
- 2. The data β the lists and numbers near the top. These are the bits you change.
- 3. The work β a little maths, or a loop that repeats a step.
- 4. Show it β
print(...)writes words;plt.show()draws the picture.
Use it for your own problems
- Change the numbers at the top and press Run β nothing breaks, so experiment!
- Ask your own version of the question β swap in your family, your scores, your week.
- The same tools work on any numbers β that's the superpower you're learning.
Need a hint?
The agent reads the goal, spots a keyword (a number, 'weather', or neither), and calls the matching tool.