FreeCampus FreeCampus Python
  • Home
  • Courses
    • All courses

    • Python Foundations
    • Intermediate Python
    • Advanced Python
    • Scientific Computing
    • Statistics
    • Data Science & Machine Learning
  • Pathways
  • FAQ

Python Foundations

  • Overview
  • Milestone 1: Write and Explain Your First Programs
    • Milestone overview
    • Unit 0: Get Started
      • Overview
      • Meet Python Through a Tiny Program
      • Learn with Predictions and Evidence
      • Use AI While Keeping the Thinking Yours
      • Work Reliably in Colab and Jupyter
      • Build a Dependable Local Python Workspace
      • Unit Challenge
    • Unit 1: Learning to Read and Write Python Code
      • Overview
      • Values, Names, and Assignment
      • Expressions, Statements, and Execution Order
      • Python’s Words and Symbols
      • Indentation and Code Blocks
      • Writing Python Across Multiple Lines
      • Comments and Docstrings That Help
      • Reading and Fixing Syntax Errors
      • Unit Challenge
    • Unit 2: Numbers, Text, and Other Values
      • Overview
      • Values, Types, Conversion, and None
      • Integers and Everyday Arithmetic
      • Floating-Point Numbers and Precision
      • Money, Exact Ratios, and Complex Numbers
      • Strings and Unicode Text
      • Input, Output, and Clear Formatting
      • Booleans, Comparisons, and Truth
      • Dates, Times, and Durations
      • Unit Challenge
    • Milestone Challenge
  • Milestone 2: Turn Data into Reusable Decisions
    • Milestone overview
    • Unit 3: Organizing and Traversing Collections
      • Overview
      • Lists: Keeping Values in Order
      • Tuples and Unpacking Fixed Records
      • Dictionaries: Finding Values by Key
      • Sets: Uniqueness and Group Comparisons
      • Visiting Items in a Collection
      • Sorting Collections Without Losing Meaning
      • Building and Reading Nested Data
      • Unit Challenge
    • Unit 4: Making Decisions and Repeating Work
      • Overview
      • Choosing a Path with if, elif, and else
      • Combining Conditions Without Surprises
      • Turning Rules into Complete Decisions
      • Building Results with for Loops
      • Repeating Until Something Changes
      • Searching, Skipping, and Stopping Loops
      • Working Through Grids and Pairs
      • Building Collections with Comprehensions
      • Unit Challenge
    • Unit 5: Building Reusable Functions
      • Overview
      • Defining Functions and Returning Useful Results
      • Designing Clear Parameters and Calls
      • Breaking a Program into Small Functions
      • Following Names Through Function Calls
      • Passing Functions as Values
      • Solving Smaller Problems with Recursion
      • Producing Values One at a Time
      • Adding Behavior with Decorators
      • Unit Challenge
    • Unit 6: Sharing, Changing, and Copying Objects
      • Overview
      • When Names Share the Same Object
      • Changing Objects and Choosing Safe Keys
      • Copying Nested Data Without Surprises
      • Designing Functions That Control Mutation
      • Unit Challenge
    • Milestone Challenge
  • Milestone 3: Build Reliable Programs from External Data
    • Milestone overview
    • Unit 7: Solving Problems with Algorithms
      • Overview
      • Turn a Vague Idea into Testable Examples
      • Turn a Plan into Working Python
      • Choose an Algorithm That Fits
      • Know It Works and Understand the Cost
      • Unit Challenge
    • Unit 8: Errors, Exceptions, and Debugging
      • Overview
      • Understand Failures and Read Tracebacks
      • Raise Useful Errors and Handle Expected Failures
      • Debug One Hypothesis at a Time
      • Pause, Inspect, and Shrink a Bug
      • Unit Challenge
    • Unit 9: Files, Paths, and External Data
      • Overview
      • Find, Read, and Write Files Reliably
      • Keep Text Intact Across Encodings and Newlines
      • Move Records Between CSV, JSON, YAML, and Python
      • Turn Messy Text into Trustworthy Records
      • Cross the Text–Binary Boundary Safely
      • Unit Challenge
    • Unit 10: Modules, Environments, and Python Projects
      • Overview
      • Find the Right Tool Without Memorizing Everything
      • Turn One Script into Reusable Modules
      • Design a Package People Can Rely On
      • Build a Project You Can Navigate and Share
      • Give Each Project a Clean Python Environment
      • Build and Verify an Installable Python Project
      • Unit Challenge
    • Milestone Challenge
  • Milestone 4: Ship a Tested and Documented Python Tool
    • Milestone overview
    • Unit 11: Object-Oriented Python and Dataclasses
      • Overview
      • Build Your First Useful Class
      • Keep Objects in Valid States
      • Use Dataclasses for Value-Like Objects
      • Choose Composition Before Inheritance
      • Model a Complete Road-Crossing Game
      • Unit Challenge
    • Unit 12: Command-Line Applications
      • Overview
      • Design a Friendly Command with argparse
      • Put Output, Errors, and Exit Status in the Right Place
      • Resolve Configuration Without Exposing Secrets
      • Write Useful Logs Without Polluting Output
      • Keep the Command Thin and the Core Reusable
      • Unit Challenge
    • Unit 13: Testing Python Programs
      • Overview
      • Write Tests That Protect Behavior
      • Run Pytest and Read the Failure
      • Turn Examples into Clear Parametrized Cases
      • Build an Isolated Test World with Fixtures
      • Control Dependencies Without Fragile Mocks
      • Test at the Smallest Boundary That Can Fail
      • Preserve Bugs and Explore General Rules
      • Unit Challenge
    • Unit 14: Code Quality and Maintainability
      • Overview
      • Write Python People Can Follow
      • Make Contracts Visible with Type Annotations
      • Read MyPy Errors and Close Type Gaps
      • Format and Lint a Project with Ruff
      • Catch Small Problems Before Commit
      • Repeat the Quality Gate in CI
      • Refactor in Small, Verified Steps
      • Unit Challenge
    • Unit 15: Documentation as Part of the Product
      • Overview
      • Design Documentation Around Reader Needs
      • Write Instructions People Can Follow
      • Document a Public Python API
      • Keep Small Examples Honest with Doctest
      • Review Documentation Like Code
      • Build a Documentation Site with Quarto
      • Publish Documentation and Keep It Trustworthy
      • Unit Challenge
    • Milestone Challenge
FreeCampus Python

Python Foundations

Start with zero programming experience and finish able to build, test, explain, document, and maintain practical Python programs.
Course progress 0%

No prerequisites · 4 milestones · 16 units · 97 lessons · Free to study

Active study: 388–556 hours, at your own pace.

Start Unit 0 Explore the units

Start with small programs in your browser. Progress through the language, then build Python projects with files, packages, command-line tools, tests, and documentation. This is a substantial course: take one lesson at a time.

0%course work recorded
0/97lessons
0/20unit and milestone challenges
117 course activities remaining Course in progress

What you will learn

  • Read, write, and explain Python programs.
  • Work with values, collections, functions, objects, and files.
  • Find bugs and check that your programs behave as intended.
  • Build, test, document, and share practical Python projects.

Milestone sequence

Each milestone combines its units in an ungraded challenge. Complete the unit challenges as you go, then use the milestone challenge to connect those skills. Progress is self-reported in this browser on this device.

  • Write and Explain Your First Programs — 3 units; milestone challenge.
  • Turn Data into Reusable Decisions — 4 units; milestone challenge.
  • Build Reliable Programs from External Data — 4 units; milestone challenge.
  • Ship a Tested and Documented Python Tool — 5 units; milestone challenge.

Before you start

You only need a browser to begin; no programming or mathematics prerequisite is assumed.

Practice setup: start in Colab, then learn local workflows for larger projects. Lessons combine explanations, runnable examples, checkpoints, and a lab. Each unit ends with a challenge that brings its ideas together.

Learning sequence

Python Foundations curriculum version 22 contains 16 units and 97 cohesive lessons, grouped into 4 milestones. Each unit begins with an Overview and ends with a challenge. Each milestone ends with a separate challenge connecting its units: 16 unit challenges and 4 milestone challenges.

00Get StartedRun your first program and choose a reliable practice workflow.5 lessons

Unit overview · Unit challenge

  1. Meet Python Through a Tiny Program
  2. Learn with Predictions and Evidence
  3. Use AI While Keeping the Thinking Yours
  4. Work Reliably in Colab and Jupyter
  5. Build a Dependable Local Python Workspace
01Learning to Read and Write Python CodeRead Python instructions and repair common syntax errors.7 lessons

Unit overview · Unit challenge

  1. Values, Names, and Assignment
  2. Expressions, Statements, and Execution Order
  3. Python’s Words and Symbols
  4. Indentation and Code Blocks
  5. Writing Python Across Multiple Lines
  6. Comments and Docstrings That Help
  7. Reading and Fixing Syntax Errors
02Numbers, Text, and Other ValuesChoose, convert, and format numbers, text, truth values, and time.8 lessons

Unit overview · Unit challenge

  1. Values, Types, Conversion, and None
  2. Integers and Everyday Arithmetic
  3. Floating-Point Numbers and Precision
  4. Money, Exact Ratios, and Complex Numbers
  5. Strings and Unicode Text
  6. Input, Output, and Clear Formatting
  7. Booleans, Comparisons, and Truth
  8. Dates, Times, and Durations
03Organizing and Traversing CollectionsOrganize data and work through collections without losing relationships.7 lessons

Unit overview · Unit challenge

  1. Lists: Keeping Values in Order
  2. Tuples and Unpacking Fixed Records
  3. Dictionaries: Finding Values by Key
  4. Sets: Uniqueness and Group Comparisons
  5. Visiting Items in a Collection
  6. Sorting Collections Without Losing Meaning
  7. Building and Reading Nested Data
04Making Decisions and Repeating WorkTurn rules into decisions and repeat work with loops.8 lessons

Unit overview · Unit challenge

  1. Choosing a Path with if, elif, and else
  2. Combining Conditions Without Surprises
  3. Turning Rules into Complete Decisions
  4. Building Results with for Loops
  5. Repeating Until Something Changes
  6. Searching, Skipping, and Stopping Loops
  7. Working Through Grids and Pairs
  8. Building Collections with Comprehensions
05Building Reusable FunctionsBuild functions with clear inputs, results, and behavior.8 lessons

Unit overview · Unit challenge

  1. Defining Functions and Returning Useful Results
  2. Designing Clear Parameters and Calls
  3. Breaking a Program into Small Functions
  4. Following Names Through Function Calls
  5. Passing Functions as Values
  6. Solving Smaller Problems with Recursion
  7. Producing Values One at a Time
  8. Adding Behavior with Decorators
06Sharing, Changing, and Copying ObjectsUnderstand shared objects and control changes and copies.4 lessons

Unit overview · Unit challenge

  1. When Names Share the Same Object
  2. Changing Objects and Choosing Safe Keys
  3. Copying Nested Data Without Surprises
  4. Designing Functions That Control Mutation
07Solving Problems with AlgorithmsBreak problems into steps and check your algorithms.4 lessons

Unit overview · Unit challenge

  1. Turn a Vague Idea into Testable Examples
  2. Turn a Plan into Working Python
  3. Choose an Algorithm That Fits
  4. Know It Works and Understand the Cost
08Errors, Exceptions, and DebuggingRead errors, investigate bugs, and verify repairs.4 lessons

Unit overview · Unit challenge

  1. Understand Failures and Read Tracebacks
  2. Raise Useful Errors and Handle Expected Failures
  3. Debug One Hypothesis at a Time
  4. Pause, Inspect, and Shrink a Bug
09Files, Paths, and External DataRead, validate, and write files and external records.5 lessons

Unit overview · Unit challenge

  1. Find, Read, and Write Files Reliably
  2. Keep Text Intact Across Encodings and Newlines
  3. Move Records Between CSV, JSON, YAML, and Python
  4. Turn Messy Text into Trustworthy Records
  5. Cross the Text–Binary Boundary Safely
10Modules, Environments, and Python ProjectsOrganize reusable code and build reproducible Python projects.6 lessons

Unit overview · Unit challenge

  1. Find the Right Tool Without Memorizing Everything
  2. Turn One Script into Reusable Modules
  3. Design a Package People Can Rely On
  4. Build a Project You Can Navigate and Share
  5. Give Each Project a Clean Python Environment
  6. Build and Verify an Installable Python Project
11Object-Oriented Python and DataclassesModel data and behavior with classes and dataclasses.5 lessons

Unit overview · Unit challenge

  1. Build Your First Useful Class
  2. Keep Objects in Valid States
  3. Use Dataclasses for Value-Like Objects
  4. Choose Composition Before Inheritance
  5. Model a Complete Road-Crossing Game
12Command-Line ApplicationsBuild commands with clear inputs, output, and useful errors.5 lessons

Unit overview · Unit challenge

  1. Design a Friendly Command with argparse
  2. Put Output, Errors, and Exit Status in the Right Place
  3. Resolve Configuration Without Exposing Secrets
  4. Write Useful Logs Without Polluting Output
  5. Keep the Command Thin and the Core Reusable
13Testing Python ProgramsProtect behavior with focused, reliable tests.7 lessons

Unit overview · Unit challenge

  1. Write Tests That Protect Behavior
  2. Run Pytest and Read the Failure
  3. Turn Examples into Clear Parametrized Cases
  4. Build an Isolated Test World with Fixtures
  5. Control Dependencies Without Fragile Mocks
  6. Test at the Smallest Boundary That Can Fail
  7. Preserve Bugs and Explore General Rules
14Code Quality and MaintainabilityMake code easier to read and safer to change.7 lessons

Unit overview · Unit challenge

  1. Write Python People Can Follow
  2. Make Contracts Visible with Type Annotations
  3. Read MyPy Errors and Close Type Gaps
  4. Format and Lint a Project with Ruff
  5. Catch Small Problems Before Commit
  6. Repeat the Quality Gate in CI
  7. Refactor in Small, Verified Steps
15Documentation as Part of the ProductWrite, check, and publish documentation people can use.7 lessons

Unit overview · Unit challenge

  1. Design Documentation Around Reader Needs
  2. Write Instructions People Can Follow
  3. Document a Public Python API
  4. Keep Small Examples Honest with Doctest
  5. Review Documentation Like Code
  6. Build a Documentation Site with Quarto
  7. Publish Documentation and Keep It Trustworthy

Assessment and progress

Predict, run, explain, modify, quiz, and debug as you work through each lesson. Then apply what you learned in the unit challenge. Most challenges take 60–120 minutes and include progressive checks, hints, and a solution to review when you need it.

Progress is saved privately in this browser and is self-reported. It is not a grade or a verified credential. The final project and certificate are planned; participation details will be announced when they are available.

Study offline

Download the complete Foundations study book

The PDF contains the full course, printable checkpoints and answers, offline study guidance, and a personal study record. Use lesson links to return to Colab when you want to run code. PDF reading does not update your browser progress.

Back to top
Milestone overview

FreeCampus Python — learn by building, explaining, and debugging.

Course content updated 21 October 2026 · Curriculum v22

  • Edit this page
  • Report an issue
  • GitHub