Py Course · 61 lessons · approx. 395 minutes

Learn Python

Python is easy to read and incredibly versatile – from small scripts to data analysis. Your code runs directly in the app in the safe learning interpreter.

  • print & Variablen
  • Strings & Zahlen
  • Conditions
  • Loops
  • Listen & Dicts
  • Functions
  • Data analysis
  • Your own programs & going deeper
  • Cleaning up and comparing text
  • Dictionary.get: a missing key
  • enumerate: position and value
  • Tuples: keeping values together
  • sorted: an ordered copy
  • Slicing: a piece of a list
  • assert: checking an assumption
  • List comprehension: a list in one line
  • zip: two lists in pairs
  • sorted with key: ordering by a feature
  • set: removing duplicate entries
  • Multiple return values
  • Cleaning up text input before comparing
  • Handling missing dictionary values with get
  • Building a simple word frequency
  • Running totals with an accumulator
  • Returning early from a function for invalid values
  • Copying a list with a slice
  • Checking a calculation with assert
  • Joining list values into one output
  • Modules & imports
  • Error handling & debugging
  • Functions for pros
  • Testing with assert
  • Databases with sqlite3

What you’ll learn

  1. Chapter 1print, variables & data types – Your first lines of Python.
    Hallo, Python! · Variables & data types
  2. Chapter 2Strings, numbers & input/output – Calculating, converting, reading input.
    Calculating & converting
  3. Chapter 3Conditions – if, elif, else – and indentation.
    if, elif & else
  4. Chapter 4Loops – for, while and range.
    for & while
  5. Chapter 5Lists, tuples, sets & dicts – Collecting and organising data.
    Lists & dictionaries
  6. Chapter 6Functions – Parameters, return values, default values.
    Functions
  7. Chapter 7Your code workshop – Connect what you have learned and discover a new building block.
    A sum step by step
  8. Chapter 8Workshop: understand and build it yourself – Practise new building blocks with short explanations and your own programs.
    Cleaning up texts · Evaluating a list in a function · Catching errors in an input
  9. Chapter 9New tools for your own ideas – Understand new concepts, fill them in and use them yourself.
    Cleaning up and comparing text · Dictionary.get: a missing key · enumerate: position and value
  10. Chapter 10Level up: your next practice chapter – Understand four new building blocks in small steps and use them yourself.
    Tuples: keeping values together · sorted: an ordered copy · Slicing: a piece of a list · assert: checking an assumption
  11. Chapter 11Master chapter: how real programs are built – Five building blocks from real projects – explained, connected, filled in and written by you.
    List comprehension: a list in one line · zip: two lists in pairs · sorted with key: ordering by a feature · set: removing duplicate entries · Multiple return values
  12. Chapter 12Project tools: understand and apply – Eight more building blocks with explanation pages and four exercises per lesson.
    Cleaning up text input before comparing · Handling missing dictionary values with get · Building a simple word frequency · Running totals with an accumulator · Returning early from a function for invalid values · Copying a list with a slice · Checking a calculation with assert · Joining list values into one output
  13. Chapter 13Modules & imports – Use ready-made tools from the standard library – with import, from and as.
    import: loading a module · from … import: fetching specifically · as: a shorter name · Rounding: round, floor and ceil · Boss: the circle calculator
  14. Chapter 14Error handling & debugging – Catch errors, report them yourself and find them with intermediate outputs.
    try and except: catching errors · else and finally · raise: reporting an error yourself · Debugging: showing intermediate values · Boss: a safe input
  15. Chapter 15Functions for pros – Default values, named arguments, lambdas, recursion and functions as values.
    Default values for parameters · Named arguments · Lambda with sorted, map and filter · Recursion: a function calls itself · Boss: functions as tools
  16. Chapter 17Object orientation – Classes and objects.
    The first class: __init__ and self · Methods: objects can do things · __str__: printing objects nicely · Inheritance: one class extends another · Boss: a grade book made of objects
  17. Chapter 18Testing with assert – Write your own tests, check edge cases, expect errors and build a small test run – without any extra packages.
    Writing a test function · Checking edge cases · Expecting errors · A small test run · Boss: test first, then code
  18. Chapter 23Databases with sqlite3 – Create tables from Python, change rows, read results as dictionaries and catch database errors – for real on the learning database.
    Creating a table from Python · Changing and counting: UPDATE and rowcount · Reading rows as dictionaries · Catching database errors · Boss: a small grade manager

Final project: Python quiz game

A quiz with questions, evaluation and a score.

How it works

Every lesson starts with short explanation pages. Then you practise with multiple-choice questions, fill-in-the-gap tasks, putting code in order and writing your own code – with hints and instant feedback. Free, without ads, on phone, tablet and PC.

Learn Python now