Course overview
A practical introduction to Python 3 for first-time programmers. Learners progress from their first program to a tested command-line application through focused units, worked examples, guided practice, knowledge checks, and cumulative projects.
Standalone unit guides
Every unit is designed to be followed independently: review the guide, complete the lessons in order, finish the practical lab, pass the checkpoint, and deliver the unit project.
1. Getting Started with Python7 lessons
Prerequisites: No programming experience is required. You need a browser, a text editor, and Python 3.12 installed.
This is the true starting point for Python. You do not need to know another language. Begin with visible programs that print text and calculate values, then gradually add user input, decisions, repetition, and functions. Every lesson follows the same rhythm: read the idea, run the worked example, change one thing, complete guided practice, and finish an independent challenge.
Do not try to memorise all Python syntax at once. Learn to ask four questions: what values does the program receive, what values does it create, which rule decides the next step, and what result should be returned or displayed? Keep a notebook of new words (variable, string, condition, loop, function) and write one example for each. When an error appears, read the final line, locate the line number, and make the smallest correction.
The unit ends with an expense tracker. You will first write it with a few hard-coded values, then add input, validation, a loop, and functions. The project is intentionally small: its purpose is to prove that you can turn a plain-language problem into a working Python program. Completion means you can explain the code to another beginner, change one rule safely, and run it again from a clean environment.
Unit outcomes
- Write and run small Python programs from a file and the interactive prompt.
- Use variables, strings, numbers, booleans, input, and output to model simple problems.
- Translate everyday rules into conditions, loops, and reusable functions.
- Build and explain a small command-line expense tracker from a blank file.
Unit project
Build a command-line expense tracker. It must collect expenses, reject invalid or negative amounts, calculate total and average, compare the total with a budget, and print a clear summary. Organize the program into functions and include at least six tests or documented manual test cases.
Guided practice
- Create and run a three-line greeting program, then change one value and predict the output before running it.
- Build a receipt calculation using variables, numeric operators, and an f-string.
- Write one decision, one loop, and one function for the same small score-processing problem.
- Complete the expense tracker and test empty input, a negative amount, a budget boundary, and three ordinary expenses.
Further reading
- Python Tutorial: using the interpreter
- Python Tutorial: first steps
- Fluent Python lens: learning through concrete Python objects
Lesson sequence
- How Computer Programs Work - Free preview
- Setting Up the Python Environment
- Running Python Code
- Writing Your First Program
- Understanding Basic Errors
- Code Comments
- Mini-Project: Personal Introduction Program
6 dedicated checkpoint questions
2. Variables and Basic Data Types9 lessons
Lesson sequence
- Creating and Updating Variables
- Variable Naming Conventions
- Working with Strings
- Formatting Output with f-Strings
- Working with Integers and Floats
- Arithmetic Operators and Operator Precedence
- Understanding Data Types with type()
- Converting Data with str(), int(), and float()
- Mini-Project: Personal Budget Calculator
6 dedicated checkpoint questions
3. User Input and Data Conversion7 lessons
Lesson sequence
- Reading Input with input()
- Storing and Displaying User Input
- Converting Numeric Input
- Processing Multiple Inputs
- Validating Simple User Input
- Handling Conversion Errors
- Mini-Project: Unit Converter
6 dedicated checkpoint questions
4. Conditional Logic9 lessons
Lesson sequence
- Boolean Values
- Comparison Operators
- Writing if Statements
- Using if and else
- Handling Multiple Cases with elif
- Combining Conditions with and, or, and not
- Membership Tests with in and not in
- Nested Conditions
- Mini-Project: Ticket Price Calculator
6 dedicated checkpoint questions
5. Working with Lists11 lessons
Lesson sequence
- Introduction to Collections
- Creating Lists
- Accessing Elements by Index
- Understanding Zero-Based Indexing
- Updating List Elements
- Adding Elements with append() and insert()
- Removing Elements with remove(), pop(), and del
- Sorting Lists
- Finding the Length of a List
- Understanding IndexError
- Mini-Project: Shopping List Manager
6 dedicated checkpoint questions
6. Loops and Repetitive Tasks11 lessons
Lesson sequence
- Iterating over a List with for
- Understanding Code Blocks and Indentation
- Generating Number Sequences with range()
- Using Counters and Accumulators
- Repeating Code with while
- Defining Loop Termination Conditions
- Exiting a Loop with break
- Skipping an Iteration with continue
- Preventing Infinite Loops
- Choosing Between for and while
- Mini-Project: Number Guessing Game
6 dedicated checkpoint questions
7. Dictionaries and Structured Data11 lessons
Lesson sequence
- Understanding Key-Value Data
- Creating a Dictionary
- Accessing Dictionary Values
- Adding and Updating Key-Value Pairs
- Removing Dictionary Entries
- Using the get() Method
- Iterating over Keys and Values
- Working with Lists of Dictionaries
- Introduction to Tuples
- Choosing the Appropriate Data Structure
- Mini-Project: Contact Book
6 dedicated checkpoint questions
8. Functions and Code Reuse11 lessons
Lesson sequence
- Why Functions Are Useful
- Defining and Calling a Function
- Passing Function Arguments
- Parameters and Arguments
- Returning Values with return
- Default Parameter Values
- Keyword Arguments
- Variable Scope
- Decomposing a Problem into Functions
- Importing Functions and Modules
- Mini-Project: Calculation Toolkit
6 dedicated checkpoint questions
9. Files, Exceptions, and Data Persistence14 lessons
Lesson sequence
- Introduction to Data Persistence
- Understanding File Paths
- Working with pathlib
- Reading Text Files
- Writing Text Files
- Appending Content to a File
- Introduction to JSON
- Saving Structured Data
- Loading Structured Data
- Understanding Exceptions
- Handling Exceptions with try and except
- Using else and finally
- Writing Clear Error Messages
- Mini-Project: Persistent Score Tracker
6 dedicated checkpoint questions
10. Object-Oriented Programming Fundamentals11 lessons
Lesson sequence
- From Data and Functions to Objects
- Understanding Classes and Objects
- Defining a Class
- Initializing Objects with __init__()
- Understanding the self Parameter
- Defining Instance Attributes
- Defining Instance Methods
- Creating and Using Multiple Objects
- Updating Object State
- Introduction to Composition
- Mini-Project: Library Item Manager
6 dedicated checkpoint questions
11. Testing and Debugging11 lessons
Lesson sequence
- Understanding Bugs and Failures
- Reading Tracebacks
- Using Print-Based Debugging
- Formulating Debugging Hypotheses
- Using assert for Simple Checks
- Introduction to Automated Testing
- Writing Tests with pytest
- Testing Return Values
- Testing Expected Exceptions
- Refactoring Code Safely
- Mini-Project: Test an Existing Application
6 dedicated checkpoint questions
12. Final Project: Building a Command-Line Application12 lessons
Lesson sequence
- Defining the Project Requirements
- Identifying Inputs, Processes, and Outputs
- Selecting Appropriate Data Structures
- Designing the Program Flow
- Implementing the Minimum Viable Product
- Splitting the Program into Functions
- Adding Data Persistence
- Handling Invalid Input and Runtime Errors
- Writing Automated Tests
- Refactoring and Improving Code Quality
- Writing User Documentation
- Final Project Review
6 dedicated checkpoint questions