Skip to content
BetaDE

Learning area

Python

You start from zero and work your way up lesson by lesson to the pro topics. Every lesson has examples to try, a task and an automatic check.

💡 New here? First: what is Python anyway?

0 of 35 lessons done

All lessons with learning goals

Stage 1Beginner

  1. 01
    15 minutes

    Hello, Python! 🏆 (with a pro task)

    Print text and numbers with print() · Create and use variables · Combine text and numbers with f-strings

  2. 02
    20 minutes

    Decisions with if 🏆 (with a pro task)

    Read input with input() and turn it into numbers with int() · Compare values (<, >, ==, …) · Take different paths with if, elif and else

  3. 03
    20 minutes

    Loops – repeating things 🏆 (with a pro task)

    Run code several times with for and range() · Repeat with while as long as something is true · Recognise and avoid endless loops

  4. 04
    45 minutes

    Project: Drawing with the turtle

    Draw lines, shapes and colours with the turtle · Use loops and functions to create patterns · Program your own artwork and save it as a picture

  5. 05
    25 minutes

    Lists – many values at once 🏆 (with a pro task)

    Create lists and access items by position (index) · Append, change and count items · Analyse lists with sum(), max() and a loop

  6. 06
    25 minutes

    Working with strings

    Cut out single letters and pieces of text · Change text with upper(), lower() and replace() · Count letters with a loop

  7. 07
    40 minutes

    Project: Hangman

    Process text letter by letter · Work with a set of guessed letters · Build a complete guessing game with a while loop

  8. 08
    25 minutes

    Dictionaries

    Store data as pairs of key and value · Look up, change and add values · Go through all pairs with items()

  9. 09
    45 minutes

    Project: text adventure

    Build a game loop with while · Store a game world as a nested dictionary · Check input and react clearly

  10. 10
    30 minutes

    Your own functions 🏆 (with a pro task)

    Write your own functions with def · Pass values in with parameters and give them back with return · Reuse functions inside other functions

  11. 11
    30 minutes

    Bug detective: finding bugs

    Read error messages from the bottom up · Find bugs that don't produce an error message · Look inside a program with print() and “Steps”

  12. 12
    45 minutes

    Project: quiz game

    Organise data as a list of dictionaries · Compare answers tolerantly and count points · Split the program into functions

  13. 13
    45 minutes

    Boss level: the school report program

    Combine everything from the beginner stage in one project · Analyse data with dictionaries, loops and functions · Present a result clearly

Stage 2Intermediate

  1. 14
    25 minutes

    Catching errors with try

    Understand when programs crash · Catch errors with try and except · Handle different kinds of errors differently

  2. 15
    30 minutes

    Tuples and sets

    Use tuples as unchangeable pairs of values · Remove duplicate values with sets · Form intersections, unions and differences

  3. 16
    25 minutes

    Reading and writing files

    Write and read files with open() and with · Process the lines of a file · Append data to a file

  4. 17
    30 minutes

    JSON – saving data like the pros

    Understand what JSON is and where it's used · Save and load dictionaries and lists with json · Keep working with saved data

  5. 18
    45 minutes

    Project: guessing game with high score

    Build a game with a while loop and break · Save a record in a file and load it again · Catch a missing file with try/except

  6. 19
    25 minutes

    Modules – ready-made toolboxes

    Import modules like math and random · Tell import, from … import and as apart · Write and use your own module

  7. 20
    25 minutes

    Your own tests with assert

    Check with assert whether code calculates correctly · Find and test edge cases · Write test functions like the pros

  8. 21
    25 minutes

    List comprehensions

    Create lists in a single line · Filter with if inside a comprehension · Write dictionary comprehensions

  9. 22
    45 minutes

    Project: weather station

    Store measurements in lists and go through them in pairs with zip() · Calculate the average, minimum and maximum · Show data as a bar chart made of text

  10. 23
    45 minutes

    Project: tic-tac-toe

    Represent a board as a list of lists · Check rows, columns and diagonals · Split a game into clear functions

  11. 24
    35 minutes

    Classes and objects

    Write your own blueprint for objects with class · Set attributes in __init__ and use them through self · Write methods that change an object

  12. 25
    30 minutes

    Inheritance – extending classes

    Let one class inherit from another · Override methods and extend them with super() · Check what an object is with isinstance()

  13. 26
    30 minutes

    Special methods and @property

    Decide with __str__ how print() shows an object · Compare and calculate with objects using __eq__, __lt__ and __add__ · Write calculated attributes with @property

  14. 27
    35 minutes

    Bug detective 2: classes and exceptions

    Read longer error messages (tracebacks) step by step · Find bugs in classes (forgotten self, wrong calculation) · Check things deliberately with assert and f"{x=}"

  15. 28
    60 minutes

    Boss level: the library

    Design your own class with several methods · Report errors with your own exceptions · Save data in a file and load it again