Topics and order
Work through the topics in order if you are new to Python โ each one only uses ideas from the topics before it.
| Topic | Exercises | Covers |
|---|---|---|
| Python basics | 6 | print(), variables, input(), int/float, arithmetic, f-strings |
| String exercises | 6 | indexing, slicing, methods (upper, split, join, replace), counting, palindromes |
| List exercises | 6 | indexing, append, sum/min/max, sorting, comprehensions, removing duplicates |
| Loop exercises | 6 | for, while, range, nested loops, break, patterns, prime numbers |
| Function exercises | 6 | def, parameters, return values, default arguments, recursion |
| Dictionary exercises | 6 | dict creation, get, loops over items, counting, grouping, inverting, nested data |
Why practise with auto-checked exercises?
Reading code feels like learning, but you only find the gaps when you write it yourself. Automatic tests give you the same feedback a teacher would: they try your program with several inputs, including edge cases like an empty list or a negative number, and show you the exact output you produced next to what was expected.
Stuck? Paste your attempt into the Python code visualizer to watch it run line by line, or the syntax checker to find typos.
Python Coding - Learn Python for Android: a real Python 3 interpreter, code editor, 26 example programs and 12 marked exercises.
Frequently asked questions
Where can I practise Python online for free?
Right here. Every exercise on coding-python.com runs real Python in your browser and checks your answer automatically โ free and without an account.
Do I need to install Python?
No. The exercises use Python running inside your web browser, so they work on a laptop, Chromebook, tablet or phone.
Are the solutions included?
Yes. Each exercise has a hint and a full worked solution with an explanation. Try first โ you learn far more by attempting it.
Is my progress saved?
Yes, solved exercises and your code are saved in this browser. Clearing site data resets them.
What should I do after these exercises?
Build something: try the Python games, then small projects from the cheat sheet ideas, or practise on your phone with the app.