Definition
A project is a complete small program that combines several skills and solves a real task. Unlike an exercise, you decide its structure, so you practise the judgement that tutorials can't teach.
In simple words
Exercises are scales on a guitar, and projects are playing a whole song. You'll get stuck, search and fix things, and that's exactly what the job is like.
Why it matters
Projects are what convince employers, and they're where the separate topics finally connect in your head.
How it works
| Project | Uses | Level |
|---|---|---|
| Calculator with history | Functions, loops, files | Beginner |
| To-do list saved to JSON | Lists, dicts, JSON | Beginner |
| Quiz game with scores | Classes, files, random | Beginner |
| File organiser by type | pathlib, shutil | Intermediate |
| Expense tracker with a chart | CSV, pandas, Matplotlib | Intermediate |
| Weather client using an API | requests, JSON, errors | Intermediate |
| Tool that publishes to PyPI | argparse, tests, packaging | Advanced |
How to do one well
- Build the smallest version that works.
- Add one feature at a time, testing as you go.
- Use Git from the first day.
- Write a README with what it does and how to run it.
In code
A starting point for the to-do project. Add saving to a file, and marking items done.
tasks = []
def add(task):
tasks.append({"title": task, "done": False})
def show():
for number, task in enumerate(tasks, start=1):
mark = "x" if task["done"] else " "
print(f"{number}. [{mark}] {task['title']}")
add("Learn loops")
add("Build a project")
tasks[0]["done"] = True
show()Output
1. [x] Learn loops 2. [ ] Build a project
Common mistakes
- Starting with a huge idea and never finishing. Finish small things.
- Following a tutorial step by step and calling it your project. Change it, and add something of your own.
Check yourself
Summary
- Projects combine skills on a real task.
- Start small, and finish it.
- Use Git, and write a README.
Finished reading?