Python: from first line to expert
The friendliest first language. Print, decide, repeat, and build up to classes, generators and decorators, all in your browser.
Start the track- Your first program BeginnerMake Python print a message, and see your first output.5 min
- Variables and types BeginnerStore values under names, and learn the difference between text and numbers.6 min
- Numbers and f-strings BeginnerDo arithmetic and format results neatly with f-strings.7 min
- Input and decisions BeginnerAsk the user a question and react to the answer with if, elif and else.8 min
- Loops BeginnerRepeat work with for and range, and keep going with while.8 min
- Functions BeginnerName a piece of work with def, pass it values, and return a result.8 min
- Lists BeginnerKeep many values in order, loop over them, and sort, slice and change them.9 min
- Dictionaries IntermediateLook values up by name with dictionaries, and count things with them.9 min
- Working with text IntermediateClean, search, split and reshape strings with Python's string methods.9 min
- Comprehensions IntermediateBuild lists and dictionaries in one readable line.9 min
- Exceptions IntermediateHandle errors with try and except, and raise your own when input is wrong.10 min
- Classes AdvancedModel things in your program with classes, methods and inheritance.12 min
- Iterators and generators AdvancedProduce values one at a time with yield, and handle sequences too big to keep in memory.12 min
- Decorators and memoization ExpertWrap functions to add behaviour, and make slow recursive code fast.15 min