Python Practice — Practical Fluency
Generate Python exercises that build practical language fluency first, then apply
it to backends, CLIs, automation, AWS workflows, testing, and production-style
projects.
The center of gravity is becoming fluent enough to build useful things in
Python. FastAPI, Flask, and AWS automation are preferred application tracks,
not the whole curriculum.
Each normal practice request produces 3 exercises as separate .py files or
small Python packages, depending on topic. Use the root learning log to choose
useful practice, but do not run a progress tracker or maintain a hidden progress
database.
All user exercise work lives in this fixed repo:
/home/laborant/repos/python-practice
Do not create Python practice exercises elsewhere unless the user explicitly
gives a different path.
When To Use
- User wants Python practice, exercises, challenges, code review, or debugging.
- User asks about functions, classes, typing, pytest, files, JSON, HTTP, CLIs,
APIs, FastAPI, Flask, boto3, AWS automation, backend work, or scripts.
- User asks for backend Python learning, automation skill, AWS scripting, or
open-source Python contribution prep.
- User says "I'm stuck", "review my solution", "make it harder/easier", or asks
clarifying questions while solving Python exercises.
Workflow
Step 1: Ask For Topic If Missing
If the user did not specify a topic, offer this menu:
Which Python area do you want to practice?
1. Foundations — syntax, functions, data structures, files, exceptions
2. OOP + Design — classes, dataclasses, protocols, composition, package boundaries
3. Standard Library — pathlib, json, csv, datetime, collections, itertools, logging, argparse
4. Testing + Quality — pytest, fixtures, mocks, typing, lint-friendly design
5. Backend Python — HTTP, FastAPI, Flask, validation, middleware, service boundaries
6. Automation + AWS — boto3-shaped clients, retries, pagination, IAM-safe scripts, CLIs
7. Data + Utilities — pandas-style data handling, CSV/JSON transforms, reporting scripts
Pick one, or name a specific thing like "FastAPI dependencies" or "boto3 pagination".
Skip this step when the user names a topic directly.
Step 2: Choose Learning Mode
If the user does not specify a mode, use batch.
Modes:
batch: 3 exercises. Default for steady practice.
drill: 1 small focused task for one concept or repeated mistake.
debug: broken production-ish code plus tests.
applied: realistic backend, CLI, AWS, or automation task.
pr-simulation: read a small existing package, patch a bug, explain tradeoffs.
design-review: choose package boundaries, types, dependencies, and error
behavior before coding.
capstone: multi-step project from the capstone ladder.
Use the mode to control scope. Do not force 3 exercises when the user asks for a
small drill, review, or project-style task.
Step 3: Prepare Practice Workspace
Use /home/laborant/repos/python-practice as the exercise repo.
If it does not exist, create it as a git repo with:
README.md
learning-log.md
.gitignore
When creating exercises, put them in a date folder under that repo. Folder names
use this format:
D-mmm-YY
Examples:
3-may-26
30-apr-26
12-jun-26
Use lowercase English month abbreviations: jan, feb, mar, apr, may,
jun, jul, aug, sep, oct, nov, dec.
Rules:
- On a new day, create that day's folder.
- If the user asks for more exercises on the same day, add more exercises to the
same folder.
- Number new exercises after existing ones in that folder.
- Keep the root
learning-log.md as durable memory across days.
- Read earlier date folders when useful, especially when the log references them.
- Commit exercise additions in the
python-practice repo unless the user asks not to.
Step 4: Read Learning Context
Open /home/laborant/repos/python-practice/learning-log.md if it exists;
otherwise copy the starter shape from references/learning-log.md.
Scan:
- Recurring mistakes
- Clarifying questions the user keeps asking
- Concepts already comfortable
- Domain goals and current focus
- Last exercise batch
- Prior dated exercise folders
Do not use scripts/progress_tracker.py, progress.json, or any hidden scoring
system. Update the learning log directly after reviews and after important
clarifying questions.
Step 5: Choose Difficulty And Domain
Use references/topic-catalog.md.
Use references/practice-tracks.md when the user wants backend, FastAPI, Flask,
AWS automation, CLI/tooling, data utility, or capstone direction.
Default progression:
- Difficulty 1/5: core language and small single-file tasks
- Difficulty 2/5: functions, modules, tests, exceptions, typing, and standard library
- Difficulty 3/5: realistic scripts, CLIs, backend handlers, AWS automation boundaries
- Difficulty 4/5: project-style tasks using FastAPI, Flask, AWS automation, or packages
- Difficulty 5/5: capstone-style package or service work with phased tests
Adjust from the learning log:
- Repeated syntax/type confusion -> lower difficulty, isolate concept.
- Repeated "why this abstraction?" questions -> include design-review or package-boundary task.
- Repeated testing confusion -> include pytest fixture/mock drill.
- Strong fundamentals -> shift toward backend, automation, AWS, and project-style exercises.
- User asks for challenge -> use Difficulty 3/5 or 4/5 with tests and realistic constraints.
Step 6: Generate Exercises
Read references/exercise-templates.md before creating files.
Default batch:
- 1 completion exercise
- 1 debugging exercise
- 1 applied backend/automation/framework exercise with tests
Adapt batch mix:
- If user struggles with bugs -> 2 debugging exercises.
- If user asks many clarifying questions -> 1 concept drill, 1 guided completion, 1 applied task.
- If user is advanced -> 3 applied tasks across backend, AWS automation, testing, and utilities.
Mode-specific output:
drill: 1 file plus test.
debug: 1 broken file plus test, or 3 bugs in one focused package.
applied: 1 small module/package with README and tests.
pr-simulation: 1 small existing-style package with failing test and review prompt.
design-review: markdown prompt plus skeleton package only if useful.
capstone: module with README, phased tests, and learning-log checkpoint.
File naming:
NN_<topic>_<subtopic>_<type>.py
NN_<topic>_<subtopic>_<type>_test.py
Start NN from 01 in each date folder. If the date folder already has
exercises, continue from the highest existing number.
For package-level exercises, create:
<date-folder>/NN_<topic>_<subtopic>/
README.md
pyproject.toml
src/<package_name>/...
tests/...
Every exercise should include:
- Short header comment/docstring with topic, difficulty, domain, and source inspiration.
- Clear goal.
TODO markers for completion tasks or intentionally broken code for debug tasks.
- Tests that initially fail.
- Realistic backend/AWS/framework framing when useful.
- No hidden answer in comments.
- No full solution unless the user explicitly asks for one.
Prefer standard library first. Use FastAPI, Flask, boto3, pandas, or other
libraries only when the exercise specifically needs them; otherwise simulate
boundaries with small functions or protocols to keep setup light.
Step 7: Verify Exercises Fail Correctly
Run from the date folder or specific package folder:
python -m pytest
For single-file exercises with inline tests, run:
python <exercise_file.py>
Expected: generated exercises should fail because the user has work to do. If
any exercise passes before the user edits it, make the missing work explicit and
re-run.
Prefer pytest for backend, AWS automation, and framework work because production
Python benefits from repeatable tests.
Step 8: Deliver To User
Use this structure:
Created <count> Python exercise(s) on <topic> at Difficulty <N>/5.
Focus:
- <why these exercises were selected from learning-log.md>
Files:
- <path> — <one-line task>
- <path> — <one-line task>
- <path> — <one-line task>
Run: cd /home/laborant/repos/python-practice/<date-folder> && python -m pytest
Send me your solution when ready.
Step 9: Review User Solutions
When user asks for review:
- Run formatting/linting only if configured in the exercise. Do not invent a new toolchain.
- Run
python -m pytest.
- For single-file exercises, run
python <exercise_file.py> if that is the exercise contract.
- Read
references/review-guide.md.
- Review correctness first, then idiomatic Python, then backend/AWS/framework production concerns.
Review should call out:
- Passing/failing tests
- Bugs or edge cases
- Idiomatic Python improvements
- Type hints and API boundaries
- Error handling
- Test quality
- Backend/framework/AWS production relevance when applicable
Step 10: Update Learning Log
After each review, update /home/laborant/repos/python-practice/learning-log.md
manually.
Record:
- Date folder
- Exercises completed
- Mistakes observed
- Clarifying questions asked
- Concepts now stronger
- Concepts still weak
- Suggested next batch
Mistake examples:
mutable-default-arg
missing-return
type-confusion
exception-swallowed
path-string-not-pathlib
mock-too-broad
fixture-scope-confusion
fastapi-dependency-confusion
flask-global-state
boto3-pagination-missing
aws-retry-missing
iam-action-too-broad
not-pythonic-loop
Clarifying question examples:
- "When should I use a dataclass?"
- "When do I mock versus use a fake?"
- "Why use pathlib here?"
- "Where should validation live in FastAPI?"
- "When should I use Flask blueprints?"
- "How do I handle boto3 pagination?"
- "What makes this script safe to rerun?"
If the same clarifying question category appears twice, the next batch must
include a contrast exercise that forces the distinction.
Step 11: Interactive Help
- "I'm stuck" -> Give a hint, not the solution. Tie hint to prior mistakes.
- "Show me the solution" or equivalent explicit request -> provide the smallest complete solution and explain the key idea.
- "Explain this concept" -> Explain with a small Python example and one practical use case.
- "Why this exercise?" -> Point to learning-log patterns and target domain.
- "Make it harder" -> Add tests for edge cases, failure paths, validation, idempotency, or mocks.
- "Make it easier" -> Reduce to one concept and remove external dependencies.
- "Review this like backend Python" -> Emphasize boundaries, validation, error handling, tests, and API shape.
- "Prepare me for AWS automation" -> Use boto3-shaped clients, pagination, retries, idempotency, and dry-run patterns.
- "Help me build anything in Python" -> Rotate through foundations, packages, tests, CLIs, backend, automation, and applied projects.
Capstone Ladder
Offer capstones when the user wants project-style practice or has completed
several batches successfully.
python-toolbox: file, JSON, CSV, pathlib, argparse, logging, and tests.
automation-runner: idempotent scripts, dry-run behavior, retries, and reports.
flask-service: small Flask API with blueprints, validation, tests, and app factory.
fastapi-service: FastAPI app with dependencies, Pydantic models, routers, and tests.
aws-inventory-tool: boto3-shaped collectors with pagination, retries, filtering, and dry-run planning.
backend-worker: queue-shaped worker with retries, structured errors, and persistence boundary.
Keep capstones small enough to finish incrementally. Each phase should have tests
and a learning-log checkpoint.
Open Source Readiness
When the learning log shows repeated success with:
- Functions, data structures, and exceptions
- OOP and package boundaries
- Type hints and protocols
- pytest fixtures and mocks
- Backend validation and error handling
- AWS automation safety patterns
- Idiomatic Python style
Suggest reading and modifying small issues in Python open-source repositories.
Start with docs/tests/internal utilities before touching core runtime paths.
1---2name: python-practice3description: >4 Generate adaptive Python coding exercises for broad practical Python fluency:5 fundamentals, OOP, standard library, testing, CLIs, automation, backend services,6 FastAPI, Flask, AWS automation, data handling, and production scripting. Use whenever7 the user wants to practice Python, learn Python concepts, review Python code, debug8 Python programs, build backend APIs, automate AWS with Python, or mentions Python9 exercises, challenges, pytest, FastAPI, Flask, boto3, scripts, CLIs, or automation.10 Exercises must be created inside dated folders in /home/laborant/repos/python-practice.11 The skill tracks recurring mistakes and clarifying questions in the root learning-log.md;12 no progress tracker script or dynamic progress database is used.13metadata:14 source: https://skillmd.com/skills/nrayyagari/python-practice15---1617# Python Practice — Practical Fluency1819Generate Python exercises that build practical language fluency first, then apply20it to backends, CLIs, automation, AWS workflows, testing, and production-style21projects.2223The center of gravity is **becoming fluent enough to build useful things in24Python**. FastAPI, Flask, and AWS automation are preferred application tracks,25not the whole curriculum.2627Each normal practice request produces **3 exercises** as separate `.py` files or28small Python packages, depending on topic. Use the root learning log to choose29useful practice, but do not run a progress tracker or maintain a hidden progress30database.3132All user exercise work lives in this fixed repo:3334```text35/home/laborant/repos/python-practice36```3738Do not create Python practice exercises elsewhere unless the user explicitly39gives a different path.4041## When To Use4243- User wants Python practice, exercises, challenges, code review, or debugging.44- User asks about functions, classes, typing, pytest, files, JSON, HTTP, CLIs,45 APIs, FastAPI, Flask, boto3, AWS automation, backend work, or scripts.46- User asks for backend Python learning, automation skill, AWS scripting, or47 open-source Python contribution prep.48- User says "I'm stuck", "review my solution", "make it harder/easier", or asks49 clarifying questions while solving Python exercises.5051## Workflow5253### Step 1: Ask For Topic If Missing5455If the user did not specify a topic, offer this menu:5657```text58Which Python area do you want to practice?59601. Foundations — syntax, functions, data structures, files, exceptions612. OOP + Design — classes, dataclasses, protocols, composition, package boundaries623. Standard Library — pathlib, json, csv, datetime, collections, itertools, logging, argparse634. Testing + Quality — pytest, fixtures, mocks, typing, lint-friendly design645. Backend Python — HTTP, FastAPI, Flask, validation, middleware, service boundaries656. Automation + AWS — boto3-shaped clients, retries, pagination, IAM-safe scripts, CLIs667. Data + Utilities — pandas-style data handling, CSV/JSON transforms, reporting scripts6768Pick one, or name a specific thing like "FastAPI dependencies" or "boto3 pagination".69```7071Skip this step when the user names a topic directly.7273### Step 2: Choose Learning Mode7475If the user does not specify a mode, use `batch`.7677Modes:78- `batch`: 3 exercises. Default for steady practice.79- `drill`: 1 small focused task for one concept or repeated mistake.80- `debug`: broken production-ish code plus tests.81- `applied`: realistic backend, CLI, AWS, or automation task.82- `pr-simulation`: read a small existing package, patch a bug, explain tradeoffs.83- `design-review`: choose package boundaries, types, dependencies, and error84 behavior before coding.85- `capstone`: multi-step project from the capstone ladder.8687Use the mode to control scope. Do not force 3 exercises when the user asks for a88small drill, review, or project-style task.8990### Step 3: Prepare Practice Workspace9192Use `/home/laborant/repos/python-practice` as the exercise repo.9394If it does not exist, create it as a git repo with:95- `README.md`96- `learning-log.md`97- `.gitignore`9899When creating exercises, put them in a date folder under that repo. Folder names100use this format:101102```text103D-mmm-YY104```105106Examples:107- `3-may-26`108- `30-apr-26`109- `12-jun-26`110111Use lowercase English month abbreviations: `jan`, `feb`, `mar`, `apr`, `may`,112`jun`, `jul`, `aug`, `sep`, `oct`, `nov`, `dec`.113114Rules:115- On a new day, create that day's folder.116- If the user asks for more exercises on the same day, add more exercises to the117 same folder.118- Number new exercises after existing ones in that folder.119- Keep the root `learning-log.md` as durable memory across days.120- Read earlier date folders when useful, especially when the log references them.121- Commit exercise additions in the `python-practice` repo unless the user asks not to.122123### Step 4: Read Learning Context124125Open `/home/laborant/repos/python-practice/learning-log.md` if it exists;126otherwise copy the starter shape from `references/learning-log.md`.127128Scan:129- Recurring mistakes130- Clarifying questions the user keeps asking131- Concepts already comfortable132- Domain goals and current focus133- Last exercise batch134- Prior dated exercise folders135136Do not use `scripts/progress_tracker.py`, `progress.json`, or any hidden scoring137system. Update the learning log directly after reviews and after important138clarifying questions.139140### Step 5: Choose Difficulty And Domain141142Use `references/topic-catalog.md`.143Use `references/practice-tracks.md` when the user wants backend, FastAPI, Flask,144AWS automation, CLI/tooling, data utility, or capstone direction.145146Default progression:147- Difficulty 1/5: core language and small single-file tasks148- Difficulty 2/5: functions, modules, tests, exceptions, typing, and standard library149- Difficulty 3/5: realistic scripts, CLIs, backend handlers, AWS automation boundaries150- Difficulty 4/5: project-style tasks using FastAPI, Flask, AWS automation, or packages151- Difficulty 5/5: capstone-style package or service work with phased tests152153Adjust from the learning log:154- Repeated syntax/type confusion -> lower difficulty, isolate concept.155- Repeated "why this abstraction?" questions -> include design-review or package-boundary task.156- Repeated testing confusion -> include pytest fixture/mock drill.157- Strong fundamentals -> shift toward backend, automation, AWS, and project-style exercises.158- User asks for challenge -> use Difficulty 3/5 or 4/5 with tests and realistic constraints.159160### Step 6: Generate Exercises161162Read `references/exercise-templates.md` before creating files.163164Default batch:165- 1 completion exercise166- 1 debugging exercise167- 1 applied backend/automation/framework exercise with tests168169Adapt batch mix:170- If user struggles with bugs -> 2 debugging exercises.171- If user asks many clarifying questions -> 1 concept drill, 1 guided completion, 1 applied task.172- If user is advanced -> 3 applied tasks across backend, AWS automation, testing, and utilities.173174Mode-specific output:175- `drill`: 1 file plus test.176- `debug`: 1 broken file plus test, or 3 bugs in one focused package.177- `applied`: 1 small module/package with README and tests.178- `pr-simulation`: 1 small existing-style package with failing test and review prompt.179- `design-review`: markdown prompt plus skeleton package only if useful.180- `capstone`: module with README, phased tests, and learning-log checkpoint.181182File naming:183184```text185NN_<topic>_<subtopic>_<type>.py186NN_<topic>_<subtopic>_<type>_test.py187```188189Start `NN` from `01` in each date folder. If the date folder already has190exercises, continue from the highest existing number.191192For package-level exercises, create:193194```text195<date-folder>/NN_<topic>_<subtopic>/196 README.md197 pyproject.toml198 src/<package_name>/...199 tests/...200```201202Every exercise should include:203- Short header comment/docstring with topic, difficulty, domain, and source inspiration.204- Clear goal.205- `TODO` markers for completion tasks or intentionally broken code for debug tasks.206- Tests that initially fail.207- Realistic backend/AWS/framework framing when useful.208- No hidden answer in comments.209- No full solution unless the user explicitly asks for one.210211Prefer standard library first. Use FastAPI, Flask, boto3, pandas, or other212libraries only when the exercise specifically needs them; otherwise simulate213boundaries with small functions or protocols to keep setup light.214215### Step 7: Verify Exercises Fail Correctly216217Run from the date folder or specific package folder:218219```bash220python -m pytest221```222223For single-file exercises with inline tests, run:224225```bash226python <exercise_file.py>227```228229Expected: generated exercises should fail because the user has work to do. If230any exercise passes before the user edits it, make the missing work explicit and231re-run.232233Prefer pytest for backend, AWS automation, and framework work because production234Python benefits from repeatable tests.235236### Step 8: Deliver To User237238Use this structure:239240```text241Created <count> Python exercise(s) on <topic> at Difficulty <N>/5.242243Focus:244- <why these exercises were selected from learning-log.md>245246Files:247- <path> — <one-line task>248- <path> — <one-line task>249- <path> — <one-line task>250251Run: cd /home/laborant/repos/python-practice/<date-folder> && python -m pytest252Send me your solution when ready.253```254255### Step 9: Review User Solutions256257When user asks for review:258- Run formatting/linting only if configured in the exercise. Do not invent a new toolchain.259- Run `python -m pytest`.260- For single-file exercises, run `python <exercise_file.py>` if that is the exercise contract.261- Read `references/review-guide.md`.262- Review correctness first, then idiomatic Python, then backend/AWS/framework production concerns.263264Review should call out:265- Passing/failing tests266- Bugs or edge cases267- Idiomatic Python improvements268- Type hints and API boundaries269- Error handling270- Test quality271- Backend/framework/AWS production relevance when applicable272273### Step 10: Update Learning Log274275After each review, update `/home/laborant/repos/python-practice/learning-log.md`276manually.277278Record:279- Date folder280- Exercises completed281- Mistakes observed282- Clarifying questions asked283- Concepts now stronger284- Concepts still weak285- Suggested next batch286287Mistake examples:288- `mutable-default-arg`289- `missing-return`290- `type-confusion`291- `exception-swallowed`292- `path-string-not-pathlib`293- `mock-too-broad`294- `fixture-scope-confusion`295- `fastapi-dependency-confusion`296- `flask-global-state`297- `boto3-pagination-missing`298- `aws-retry-missing`299- `iam-action-too-broad`300- `not-pythonic-loop`301302Clarifying question examples:303- "When should I use a dataclass?"304- "When do I mock versus use a fake?"305- "Why use pathlib here?"306- "Where should validation live in FastAPI?"307- "When should I use Flask blueprints?"308- "How do I handle boto3 pagination?"309- "What makes this script safe to rerun?"310311If the same clarifying question category appears twice, the next batch must312include a contrast exercise that forces the distinction.313314### Step 11: Interactive Help315316- "I'm stuck" -> Give a hint, not the solution. Tie hint to prior mistakes.317- "Show me the solution" or equivalent explicit request -> provide the smallest complete solution and explain the key idea.318- "Explain this concept" -> Explain with a small Python example and one practical use case.319- "Why this exercise?" -> Point to learning-log patterns and target domain.320- "Make it harder" -> Add tests for edge cases, failure paths, validation, idempotency, or mocks.321- "Make it easier" -> Reduce to one concept and remove external dependencies.322- "Review this like backend Python" -> Emphasize boundaries, validation, error handling, tests, and API shape.323- "Prepare me for AWS automation" -> Use boto3-shaped clients, pagination, retries, idempotency, and dry-run patterns.324- "Help me build anything in Python" -> Rotate through foundations, packages, tests, CLIs, backend, automation, and applied projects.325326## Capstone Ladder327328Offer capstones when the user wants project-style practice or has completed329several batches successfully.3303311. `python-toolbox`: file, JSON, CSV, pathlib, argparse, logging, and tests.3322. `automation-runner`: idempotent scripts, dry-run behavior, retries, and reports.3333. `flask-service`: small Flask API with blueprints, validation, tests, and app factory.3344. `fastapi-service`: FastAPI app with dependencies, Pydantic models, routers, and tests.3355. `aws-inventory-tool`: boto3-shaped collectors with pagination, retries, filtering, and dry-run planning.3366. `backend-worker`: queue-shaped worker with retries, structured errors, and persistence boundary.337338Keep capstones small enough to finish incrementally. Each phase should have tests339and a learning-log checkpoint.340341## Open Source Readiness342343When the learning log shows repeated success with:344- Functions, data structures, and exceptions345- OOP and package boundaries346- Type hints and protocols347- pytest fixtures and mocks348- Backend validation and error handling349- AWS automation safety patterns350- Idiomatic Python style351352Suggest reading and modifying small issues in Python open-source repositories.353Start with docs/tests/internal utilities before touching core runtime paths.