Coding

Coding

Python: beginner to advanced

Learn Python through 40 progressive lessons from first steps to reusable programs, structured data, robust error handling, and efficient algorithms. Each lesson includes examples, practice questions, and a runnable coding task.

Beginner·198 min

Build reliable foundations with values, decisions, collections, loops, and functions.

Due for review
  1. 1

    Your first message

    Read a simple program and work out what it displays.

    6 min

  2. 2

    Names and values

    Store a value in a variable and use it in a message.

    8 min

  3. 3

    Calculate a total

    Use numbers and variables to solve a small everyday problem.

    8 min

  4. 4

    Building messages

    Combine text and values in a readable message.

    10 min

  5. 5

    Working with text

    Clean up text, change its case, and count characters.

    10 min

  6. 6

    Converting numbers

    Convert numeric text before doing arithmetic.

    10 min

  7. 7

    Comparing values

    Use comparisons to ask questions with true-or-false answers.

    10 min

  8. 8

    Making decisions

    Choose between two actions with if and else.

    10 min

  9. 9

    More than two choices

    Handle several cases with if, elif, and else.

    10 min

  10. 10

    Combining conditions

    Use and, or, and not to combine simple checks.

    10 min

  11. 11

    Your first list

    Keep several values in a list and access them by position.

    10 min

  12. 12

    Changing a list

    Add, replace, and remove items in a list.

    10 min

  13. 13

    Looping through items

    Use a for loop to process each list item.

    10 min

  14. 14

    Counting with range

    Repeat an action using a sequence of integers.

    10 min

  15. 15

    Totals in a loop

    Accumulate a running total while processing a list.

    10 min

  16. 16

    While loops

    Repeat a block while a condition stays true.

    10 min

  17. 17

    Named data with dictionaries

    Store related values under meaningful keys.

    10 min

  18. 18

    Reusable functions

    Define a function and pass a value to it.

    12 min

  19. 19

    Returning values

    Return a function result and use it in another calculation.

    12 min

  20. 20

    Project: a shopping receipt

    Combine a function, a list, a loop, and a condition in one small program.

    12 min