← Learn
Learn · Python

Python basics

Ten short lessons for someone who has never written code: what a program is, print(), variables, numbers and text, asking for input, making decisions, loops, lists and your own functions. Every lesson shows real code and what it prints, then asks you to read some yourself.

Part of the Python developer path.

More info

How it works

Each lesson is a short read with examples, then a few practice questions. Some ask you to type an answer (a number, an address, what a piece of code prints), some have you pick one, and some have you tap steps or lines into the right order. You can try again as often as you like; after two misses there’s a button to show the answer.

What do I need to know first?

Nothing at all. Every word is explained the first time it comes up. You don't need Python installed to follow along, but trying the examples yourself is the fastest way to learn: python.org has it free, or search for an online Python editor.

Related courses

Where is my progress saved? In this browser, like the rest of the site. Nothing to sign up for.

“Python” is a registered trademark of the Python Software Foundation. This course isn’t made by or affiliated with it.