Python for Beginners
From your very first line of code to a working program you built yourself
A free, complete Python course for absolute beginners. Learn variables, decisions, loops, lists, functions, dictionaries, files and error handling in simple English, with runnable examples, exercises with solutions and a quiz in every lesson. Finish by building a personal expense tracker.
- lessons
- 14
- lessons
- final project
- 1
- final project
- of learning
- 8 hours
- of learning
- level
- Beginner
- level
Who this course is for
- Complete beginners who have never written code
- Students and job-seekers who want a first programming skill
- Office workers who want to automate repetitive tasks
- Anyone heading towards data, AI, web or DevOps careers
What you will be able to do
- Write, run and fix Python programs on your own computer
- Store and change data with variables, lists and dictionaries
- Make decisions with if/elif/else and repeat work with for and while loops
- Organise code into functions you can reuse
- Read and write CSV files, and handle errors without crashing
- Build a complete menu-driven expense tracker from scratch
Before you start
Skills you need
- Basic computer use: opening programs, saving files in folders and typing
- No coding or maths beyond simple arithmetic
Cost and accounts
Free. No account, card or paid software needed.
Setup time
About 15 minutes to install Python and check it works (lesson 1).
Tools
- Python 3.10 or newer ↗Free from python.org. Lesson 1 walks you through installing it.
- IDLEPython's own simple editor. It is installed together with Python.
- A Windows, macOS or Linux computerA laptop or desktop. Phones and tablets are fine for reading, but you need a computer to practise.
Checked with
- Python 3.12.16: every example is run automatically and its output checked before publishing
- IDLE behaviour checked against the Python 3.12 IDLE documentation and source
- Install steps checked against python.org on 2026-11-25 (latest release: Python 3.15.2)
Last reviewed: 25 November 2026
Syllabus
Module 1: Getting started
Install Python, run programs, and work with names, numbers, text and user input.
- 1Install Python and run your first programInstall Python on Windows, macOS or Linux, open the IDLE editor, and write and run a program that prints messages on the screen.25 min
- 2Variables: giving names to valuesLearn what a Python variable is, how to create one, change its value and use it in print(), with simple naming rules and exercises.20 min
- 3Numbers and mathsDo calculations in Python with whole numbers and decimals: + - * /, whole-number division, remainders, powers and rounding, with a bill-splitting example.20 min
- 4Text: working with stringsJoin text, build messages with f-strings, and clean up text with upper(), lower(), strip() and replace() in Python, with a name-badge example.25 min
- 5Getting input from the userAsk the user questions with input(), turn their answers into numbers with int() and float(), and build a small interactive age and fees calculator.20 min
Module 2: Decisions and repetition
Make your programs choose what to do and repeat work over collections of data.
- 6Making decisions with if, elif and elseMake Python programs choose what to do with if, elif and else, compare values, combine conditions with and/or/not, and get indentation right.25 min
- 7Lists: keeping many values togetherStore many values in one Python list, read items by index, add and remove items, check membership with in, and sort, slice and measure lists.25 min
- 8for loops: repeating work for every itemRepeat code for every item in a Python list with a for loop, count with range(), add up totals with an accumulator, and filter items with if inside a loop.30 min
- 9while loops, break and continueRepeat code while a condition stays true with Python's while loop, stop early with break, skip with continue, avoid infinite loops and build a guessing game and a menu.25 min
Module 3: Organising code and data
Functions, dictionaries, files, error handling and Python's standard library.
- 10Functions: reusable blocks of codeWrite your own Python functions with def, pass in parameters, send results back with return, use default values, and understand local variables.30 min
- 11Dictionaries: looking things up by nameStore data as key-value pairs in a Python dictionary, look values up, add and update entries, loop over items, count things, and keep a list of records.30 min
- 12Reading and writing filesRead text and CSV files line by line in Python, write and append to files with open() and with, and use the csv module to load and save spreadsheet data.35 min
- 13Handling errors and reading tracebacksRead Python tracebacks to find the cause of a bug, recognise the most common error types, and handle problems gracefully with try and except.30 min
- 14Modules and the standard libraryUse import to load Python modules such as math, random, datetime and statistics, split your own code into modules, and install extra packages safely with pip and a virtual environment.30 min
Module 4: Final project
Bring everything together in a program you can actually use.
Final project
Personal expense tracker
A menu-driven program that adds expenses, saves them to a CSV file and prints a spending summary by category.
You complete the course when every lesson is marked complete and your project passes its self-check rubric.
Prerequisites
None. This course starts from zero.
This course prepares you for
- AI Skills for All · Understand how AI works and how to use it well, now that you can write code that calls it.
- SQL for Beginners · Most programs store their data in databases; SQL is how you read and shape that data.
- AI Agents Masterclass (video course) · A free video course on building AI agents, from zero to hero, chapter by chapter.