- Your first Python program What Python is, print(), and text in quotes.
- Numbers and maths Adding, multiplying, three kinds of dividing, and why 7 and "7" are different.
- Variables and f-strings Give values names, change them, and put them inside text.
- True or false Booleans, comparing values, and the difference between = and ==.
- if, elif and else Run code only when something is true, with Python’s famous indentation.
- Asking with input() Ask a question, and turn the answer into a number.
- for loops and range() Repeat code a set number of times.
- while loops Keep going while something is true, and stop with break.
- Adding things up Running totals, counting, and looping over the letters in a word.
- Lists Keep many values in one variable, and pick them out by position.
- Working with lists Loop over lists, slice them, sort them and add them up.
- Dictionaries Look things up by name instead of by position.
- Your own functions Wrap up code with def, give it inputs, and get answers back with return.
- Smarter functions Default values, giving back two things, and where variables live.
- String power tools Change case, split sentences into words, join them back, and more.
- When things go wrong Read error messages, and catch errors with try and except.
- Files Save text to a file, add to it, and read it back.
- Classes and objects Make your own types of thing, with their own data and abilities.
Write your first Python program today
Python School is part of CurlyScript, the free game that teaches JavaScript. Your progress saves as you go.