Foundations: Before Week 1
Set aside about 3 hours. You need no programming experience. By the end, you should be able to run a tiny Python program, ask an AI model for structured output, and document your work in Markdown.
Outcome: your own foundations.md containing a working Python exercise, a prompt you improved, and a short checklist for joining Session 1.
Part 1: Python essentials (60 minutes)
0:00–0:15 · Open Python and understand variables
Open Terminal on macOS/Linux or PowerShell on Windows. Check python3 --version (or py --version on Windows). If Python is missing, follow Python's official installation instructions. You should see a version number before continuing.
Create a file named hello.py in a folder you control. Type:
name = "Amara"
tasks = 3
print(f"Hello {name}, you have {tasks} tasks")
Run python3 hello.py or py hello.py. Change the name and task count. Explain in your own words what the variable stores and what print() does.
0:15–0:35 · Lists, loops, and small functions
tasks = ["read notes", "try a prompt", "save a file"]
for number, task in enumerate(tasks, start=1):
print(number, task)
def count_tasks(items):
return len(items)
print("Total:", count_tasks(tasks))
Run the script. Add one item and predict what changes before rerunning. Indentation is part of Python's syntax. A function defines reusable instructions; a list groups ordered values.
0:35–0:50 · Dictionaries and JSON
import json
record = {"learner": "Amara", "track": "business", "ready": True}
print(json.dumps(record, indent=2))
Look at the keys and values. JSON is the structured format used frequently by APIs and AI tools. Note that Python's True becomes JSON's true.
0:50–1:00 · Diagnose a broken script
Remove a closing parenthesis or the indentation from a line, run again, and read the error. Restore it. Write down the error message and what fixed it. Never paste API keys into a script or screenshots.
Check: you can run Python, explain variables and lists, and fix one simple error.
Imports: using other people's code
import os
import json
import loads a library so you can use it. os talks to your operating system. json reads and writes JSON data. You will see these at the top of every Lab script.
Environment variables: where keys live
import os
key = os.environ["OPENROUTER_API_KEY"]
os.environ reads settings from your shell. API keys live here, never in code. You set it with export OPENROUTER_API_KEY="your-key" before running your script.
Decorators: labels on functions
@mcp.tool()
def search_docs(query: str) -> str:
return "results"
The @ line above a function is a decorator. It marks the function as special, in this case telling the MCP framework "this is a tool the agent can call." You do not need to understand how it works yet. Just recognize the pattern: @something above def means the function is registered for something.
Part 2: Prompting practice (60 minutes)
1:00–1:20 · Ask with a goal, audience, and constraints
Use an AI chat tool you already have access to. Start with the vague prompt “Help me organize work.” Then compare it with:
Act as a practical project assistant. I manage a small service business. Give me a five-item daily follow-up checklist for unanswered customer enquiries. Use plain English, identify what information is missing, and do not invent customer details.
Notice how the role, context, task, format, and accuracy boundary improve the response.
1:20–1:40 · Require structured output
Ask the model for a JSON object with the exact keys task, owner, priority and next_step. Ask it to return valid JSON only, with priority equal to low, medium, or high. Paste its answer into json.loads() in Python to see whether it parses.
import json
response = '{"task":"Reply to enquiry","owner":"me","priority":"high","next_step":"Check inbox"}'
record = json.loads(response)
print(record["next_step"])
Important: a model can return plausible but inaccurate information. Check outputs against your real data.
1:40–2:00 · Evaluate and improve
Invent three non-sensitive example enquiries. Evaluate whether the model obeys your requested keys, respects missing information, and creates reasonable next steps. Improve the prompt once. Save the two prompts, one sample output and a two-sentence explanation of what changed.
Part 3: Markdown and preparation (60 minutes)
2:00–2:20 · Write readable Markdown
Open a text editor (VS Code if available). Create foundations.md. Practice:
# My Lab Foundations
## My goal
I want to reduce time spent on follow-ups.
## What I tried
- Python variables and loops
- A structured AI prompt
- JSON parsing
**My next action:** Prepare for Week 1.
Use # for headings, hyphens for lists, backticks for code, and ** for emphasis. Preview the Markdown in your editor if supported.
2:20–2:40 · Choose a safe starter project
Write a short project concept with these headings: User, Problem, Inputs, Output, and How I will check it works. Business learners can describe an automation in plain language; engineering learners may include a small Python example. Avoid entering real customer data or secret tokens.
2:40–3:00 · Final self-check
- I can run a small Python script and read an error.
- I can explain what structured JSON is.
- I wrote and improved a prompt with accuracy constraints.
- I created and saved
foundations.md. - I can find the Week 1 roadmap and know which track I plan to pursue.
If a step fails, record exactly what happened and bring that note to the first live session. Finishing every exercise perfectly is not required.