Toolpuffin

    Loading...

    Up and down to choose, Enter to open, Esc to close.

    A small course in 8 short lessons on the basics of Python, a language used for scripts, data work and much more. You learn print, variables, numbers and f-strings, choices with if, loops, functions, lists and dictionaries, and you see how Python uses indentation to group code. Python runs on your own computer, not in a web page, so this course does not run your code: it checks that your answer contains what the task asks for and shows what the program would print. A typing mistake in your code is not detected. Your code stays in your browser and your progress is remembered there.

    Features

    • 8 short lessons, from print to dictionaries
    • Check my answer, a hint and the model answer for every lesson
    • Shows what the model answer prints when you run it
    • Your progress is remembered in this browser

    How to use Learn Python

    1. Read the lesson and the task.
    2. Write your code in the editor.
    3. Press Check my answer. Use the hint or the answer if you are stuck.
    4. Go to the next lesson.

    Frequently asked questions

    Does this course run my Python code?

    No. Python runs on your own computer, not in a web page. The course uses patterns to check that your code contains what the task asks for, and shows what the model answer would print. A typing mistake in your code is not detected, so run your code yourself too.

    How can I run Python myself?

    Install Python on your computer, save your code in a file that ends in .py and run it from the command line with the python command (on some systems python3). Many code editors can run it for you as well.

    Why does indentation matter in Python?

    Python uses the spaces at the start of a line to see which lines belong together, for example the lines inside an if, a loop or a function. The usual choice is 4 spaces. If the indentation is wrong, the program does not do what you want, or does not run at all.

    Is my code saved?

    Only which lessons you finished is saved, in this browser. The code you type is not stored or sent anywhere.

    Guides

    Related tools