Hands-on Computer Science
My learning DE

Learning path400 min

Python for beginners

You write small Python programs that read input, work with numbers, text and lists, make decisions, repeat steps, organise their work in functions of their own and deal with errors.

Part 1: First programs

13 steps
  1. The basic ideas of programming Lesson 15 min
  2. Your first program Lesson 15 min
  3. Values and variables Lesson 20 min
  4. Working with text Lesson 20 min
  5. Exercise: Business card Exercise 15 min
  6. Calculating Lesson 15 min
  7. Exercise: Pizza calculator Exercise 20 min
  8. Lists Lesson 20 min
  9. Exercise: A week of weather Exercise 20 min
  10. Your own functions Lesson 25 min
  11. Cutting problems Lesson 2 Slide decks 25 min optional
  12. Exercise: Converting seconds Exercise 20 min
  13. Quiz: First programs Quiz 10 min

Part 2: Decisions

5 steps
  1. Comparisons and truth values Lesson 20 min
  2. Decisions with if, elif and else Lesson 25 min
  3. Exercise: Cinema box office Exercise 20 min
  4. Exercise: Leap year Exercise 15 min
  5. Quiz: Decisions Quiz 10 min

Part 3: Repeating

5 steps
  1. Loops with for Lesson 25 min
  2. Exercise: Grade overview Exercise 20 min
  3. Loops with while Lesson 20 min
  4. Exercise: Savings goal Exercise 20 min
  5. Quiz: Loops Quiz 10 min
About this path

This path takes you from your first print to programs that ask for input, calculate with it, make decisions, repeat steps and split their work into functions of their own. Every code box is a small editor in which you can change and run the code; Python runs in your browser, and you do not need to install anything. The first lesson does without code altogether and uses pictures from everyday life to introduce the basic ideas behind every program.

The lessons are followed by exercises in which you write a program yourself. You can unfold hints and a model solution if you get stuck, but try it on your own first, because puzzling it out is where you learn the most. The slides on cutting problems are optional and show the idea behind your own functions from a different angle.

The structure is inspired by Harvard University's CS50's Introduction to Programming with Python; texts, examples and exercises are written for this platform. It has four parts: first programs lay the foundations, decisions let a program react differently depending on the situation, repeating works through every element of a list or as many rounds as needed, and the last part shows how to read error messages and catch errors instead of letting your program crash. Each part ends with a quiz.

For whom
Everyone without programming experience
Level
Beginner
optional
25 min
Code
7924
Status
published

    A four-digit code takes you straight to the item.