ShareYourGroupShareYourGroupPython

Small Python projects for beginners

Lessons teach the pieces. Projects teach how to put them together. Each project here starts from a plan in plain words, grows in small stages that you can run and check, and ends with ideas for taking it further on your own.

How to work through a project

Do not read a project like a story. Open Python, and build it with us.

  1. Read the plan first, and try to picture which parts of the language each step needs. A loop? A dictionary? A function?
  2. Type each stage and run it before reading the next one. The stages are small on purpose. If a stage fails, the mistake is in the few lines you just added.
  3. Break it deliberately. Change a condition, feed it bad input, remove a line. Seeing how a program fails is how you learn to fix programs.
  4. Do at least one of the extension ideas at the end. This is the important part. Up to there you are following. From there you are programming.

Which project first?

They are listed from easiest to hardest. The guessing game needs lessons 1 to 9 and a little of 17 and 19. The marksheet and the bill splitter lean on dictionaries and functions, so finish lesson 16 first. The word counter uses comprehensions from lesson 20. If a project uses something you have not met, each one names the lessons it relies on, so you can read those first.

After these four

The best next project is one you want for yourself. Think of a small, boring task that you or your family do by hand: adding up monthly expenses, making a study timetable, picking chores at random, renaming photos. A program of thirty lines that solves your own problem will teach you more than a larger one copied from a book. Start with the smallest version that does anything at all, and grow it one feature at a time, exactly as the projects here do.

When your own project gets stuck on an error, the errors section is the place to look.

This is an independent learning site. It is not connected with or approved by the Python Software Foundation. "Python" is a trademark of the Python Software Foundation and is used here only to name the language.