Learn Python

A free, self-paced course that starts from "I have never written a program" and builds up to solving classic programming problems. Everything runs in your browser: there is nothing to install and nothing to sign up for.

It is written for beginners, but it is also for two kinds of experienced engineer:

  • If you have been leaning on AI to write your code and have noticed the syntax slipping, this is a place to get it back. No autocomplete, no assistant: just you, a problem, and the checks. If you are wondering whether that still matters, read Why learn to code when AI can write it? first.
  • If you have interviews coming up, the Practice section is 120 problems that end with thirty classic methods, searching, sorting, stacks and queues working together, arrays and pointers, each written from a plain-words description. Skip straight to it.
print("Hello. Press Run to see this work.")

The goal

By the end, you should be able to sit down with the 120 problems in the Practice section and solve them without asking anyone for help. Not quickly, and not without mistakes, but on your own: reading a problem, working out which tool it needs, writing the code, and fixing it until the checks pass. Everything before Practice exists to get you there.

How the course works

Every page is a short lesson with code you can run and change. Read a little, press Run, change the code, run it again. You learn by watching what happens, not by memorising.

Most lessons end with a few short exercises. You write your answer in the box, press Run tests, and the page tells you which checks passed. Keep going until they all do. If you are stuck, open a hint; they get more specific one at a time, and the full approach and a reference solution unlock once you have used them all or solved it.

Your progress is saved in this browser, so you can close the tab and come back. It does not follow you to another computer unless you export it from Settings and import it there.

The path

Work through the sections in order. Each builds on the one before.

Section What you will be able to do afterwards
1 Getting started Understand what a program is, show values, name them, and wrap steps into functions you can reuse.
2 Decisions and text Make a program behave differently depending on its input, and take text apart.
3 Collections and loops Hold many values at once and do something with each of them.
4 Stacks, queues and priority queues Choose the right structure for "what comes out next".
5 Practice Reach for the right tool without being told which one. 120 mixed problems.

Sections 1 to 4 are about 20 pages and take most people a few hours each. Section 5 is where it sticks: the problems are grouped by difficulty, not by topic, and the last thirty describe classic methods like binary search and sorting for you to build from the description.

Advice from people who have done this before

  • Forgotten some syntax? Look it up in the lessons, not elsewhere. The search box at the top of the sidebar finds pages by any word, including names like popleft or sorted. Going back to the page that taught it rebuilds the memory; a quick answer from somewhere else does not.
  • Using an AI assistant? Make it a tutor. Every exercise has a "Copy tutor prompt" button. Paste what it copies into your assistant and it will ask you questions instead of writing the answer. Asking it for the solution directly teaches you nothing.
  • Type the code yourself. Copying and pasting a reference solution teaches nothing. If you have to look at the reference, close it and write it from memory.
  • Change the examples. Every runnable block is an invitation. Break it on purpose and read the error.
  • Do not skip the exercises. Reading a page feels like understanding. The exercise is where you find out.
  • Stuck for ten minutes? Take a hint. Stuck for thirty with no hints left? Move on and come back tomorrow. It will be easier.
  • Sit for at least an hour, and give it your full attention. Close other tabs, silence your phone, and stay with it. Programming needs a stretch of unbroken focus; ten-minute visits never get past the warm-up.

Before you start

  • The first time you press Run, Python itself has to download, which takes a few seconds. After that it is instant.
  • This is an early version. If something is wrong, confusing, or a check seems unfair, please say so: open an issue on GitHub. Mention the page name.

Ready? Start with Getting started, which explains what programming is before you write any code yourself.

If this helped you

The course is free and will stay free. If you get to the end and feel it was worth something, you can send whatever you like by UPI to shravan1993@okicici, or open your UPI app with it filled in on a phone. Only if you want to, and only after it has been useful; nothing on this site depends on it. UPI works from Indian bank accounts.