Python basics
A free, hands-on introduction to Python. Short lessons, with exercises you run and check right in your browser. No account needed. Your progress is saved in this browser.
- 1Your first programPrint text to the screen, add comments, and read your first error message. 10 min
- 2Variables and numbersStore values in variables and do maths with whole numbers and decimals. 15 min
- 3Working with textJoin strings, build messages with f-strings, and pick out letters. 15 min
- 4Asking for inputRead what the user types with input() and turn it into numbers.Coming soon
- 5Making decisionsUse if, elif and else to run different code in different situations.Coming soon
- 6Repeating with loopsRepeat work with for and while loops, and know when to stop.Coming soon
- 7ListsKeep many values in order, then add, remove, sort and loop over them.Coming soon
- 8DictionariesLook values up by name, like words in a dictionary.Coming soon
- 9FunctionsPackage code into reusable functions with parameters and return values.Coming soon
- 10Handling errorsCatch problems with try and except so programs do not crash.Coming soon
- 11Files and modulesRead and write files, and use Python's standard library.Coming soon
- 12Final project: number gamePut it all together to build a complete guessing game.Coming soon