Learn Python in 10 weeks
A free, chapter-by-chapter course for complete beginners. Read one short chapter a week, try every example by pressing Run, and practise with 50 coding exercises that check your answers. Nothing to install: Python runs right in your browser.
Free10 chapters50 exercisesAbout 6 hours a week
Start Week 1 Open the practice page
The course is free to read. If it helps you, you can support new chapters with a monthly subscription.
How the course works
- Read the chapter. Each week has short sections with plain explanations and examples you can change and run.
- Practise. Every week has five exercises, from easy to a challenge. Press Check answer and the page tells you which tests pass.
- Take the quiz. Five quick questions to confirm the ideas stuck.
- Move on when you are ready. Your ticks and quiz scores are remembered in this browser only; nothing is sent to us.
The 10 chapters
- Week 1: Meet Python: your first programsRun your first lines of code, store values in variables, do arithmetic and talk to the person using your program.
- Week 2: Working with text and numbersSlice and transform strings, build messages with f-strings, and convert safely between numbers and text.
- Week 3: Making decisionsCompare values, combine conditions and choose what your program does with if, elif and else.
- Week 4: Repeating work with loopsUse for and while loops to repeat steps, build up totals and stop early with break.
- Week 5: Lists and tuplesKeep many values together, change them, sort them and filter them with list comprehensions.
- Week 6: Dictionaries and setsLook things up by name with dictionaries, count and group data, and remove duplicates with sets.
- Week 7: Functions: reusable building blocksPackage code into functions with parameters and return values, and learn how names and scope work.
- Week 8: Errors, files and JSONHandle problems calmly with try and except, read and write files, and save structured data as JSON.
- Week 9: Modules and classesBorrow ready-made tools from the standard library, then model real things with your own classes.
- Week 10: Put it together: a project and what comes nextCombine everything in a small grade-book program, test it with assert, and learn how to run Python on your own computer and where to go next.
Who this is for
Students, career changers and working professionals who have never written code, or who tried before and got stuck. If you are aiming at DevOps, cloud, data or AI work, Python is one of the most useful first languages. After Week 10, see the career paths to choose what to build next, or ask Study Buddy for a plan.
The code runs in a sandbox in your browser using Pyodide, a version of Python compiled for the web. The first Run downloads the engine (around 10 MB) and later runs are quick. It needs an internet connection and does not work with some content blockers.