Skip to content
All courses
PythonBeginner

Python Fundamentals

Start programming from scratch with Python. Store values, make decisions, repeat work with loops, write your own functions and organise data, then bring it all together in three small projects.

Free to browse. You sign in at the first lesson so your progress is saved.

What you will be able to do

  • Write programs that store, calculate and neatly format values, including money
  • Make decisions with if, elif and else, and repeat work with for and while loops
  • Slice, clean up and search text
  • Write your own functions that take parameters and return results
  • Organise data in lists and dictionaries and summarise it

Syllabus

7 modules and 28 lessons. Each lesson is a short read followed by an exercise with tests.

Module 1

Variables and types

Store values, do arithmetic and convert between types.5 lessons, about 1 hour
  1. 1Printing and variablesShow text on screen and store values under a name.10 min
  2. 2Numbers and arithmeticDo sums with whole numbers and decimals.12 min
  3. 3Whole numbers and remaindersDivide into whole groups, find what is left over and round.12 min
  4. 4Joining textBuild strings with + and with f-strings.12 min
  5. 5Types and convertingCheck what type a value is and turn text into numbers.14 min
Module 2

Making decisions

Compare values and choose which code runs.4 lessons, about 52 min
  1. 6True or falseCompare two values and get a yes or no answer.10 min
  2. 7If and elseRun code only when a condition is true.14 min
  3. 8More options with elifChoose between three or more paths.14 min
  4. 9Combining conditionsJoin conditions with and, or and not.14 min
Module 3

Working with text

Pick out parts of strings, tidy them up and format numbers neatly.3 lessons, about 42 min
  1. 10Picking out charactersUse indexes and slices to take parts of a string.14 min
  2. 11Cleaning up textChange case, trim spaces, replace words and search inside text.14 min
  3. 12Formatting numbersShow money, percentages and large numbers neatly with f-strings.14 min
Module 4

Lists and loops

Keep many values in one list and repeat work without repeating code.5 lessons, about 1 hour
  1. 13Making a listStore several values in order, then read and change them.12 min
  2. 14Looping over a listRun the same code once for every item in a list.14 min
  3. 15Adding up with a loopBuild a total or a count as a loop goes round.14 min
  4. 16Counting with rangeLoop over a sequence of numbers with range().12 min
  5. 17Repeating with whileKeep going until a condition stops being true.14 min
Module 5

Functions

Give a piece of code a name and reuse it with different values.4 lessons, about 52 min
  1. 18Writing a functionDefine your own function with def and call it.14 min
  2. 19Return or printSee why functions should usually return a value.12 min
  3. 20Several parametersPass more than one value in and return different answers.14 min
  4. 21Default valuesMake parameters optional by giving them a default.12 min
Module 6

Dictionaries

Look values up by name and keep records of data together.4 lessons, about 56 min
  1. 22Looking things upStore pairs of keys and values and look them up safely.14 min
  2. 23Changing a dictionaryAdd, update and remove keys.12 min
  3. 24Looping over a dictionaryWork through every key and value, and count things.14 min
  4. 25Lists of recordsHold many records, each with the same keys, in one list.16 min
Module 7

Putting it together

Combine everything so far in three small programs.3 lessons, about 1 hour
  1. 26Project: a shopping receiptPrint a receipt with line totals, a discount and a final total.20 min
  2. 27Project: a quiz scorerMark answers fairly, score each team and find the winner.20 min
  3. 28Project: a train plannerWork with times as text and pick the quickest train you can afford.25 min

After this course

Where to go next

This course builds on what you learn in Python Fundamentals.

  • PythonIntermediate

    Intermediate Python

    Go beyond the basics: tuples and sets, comprehensions, flexible functions, error handling, classes, dataclasses and generators, all practised in real Python in your browser.

    Recommended first: Python Fundamentals

    • 24 lessons
    • About 6 hours