All courses/Digital

Course 85 · Digital course 10

Programming with Python

Build a small Python tool by tracing calculations, writing conditions and functions, and testing ordinary and unexpected inputs.

Before you start

Choose paper or a plain text editor for your code, expected results, and notes.

See everything you’ll need

Can practice on paper · Downloadable files available · Optional Python 3 for execution. Download the starter pack

What you’ll leave with

A small Python program you can check, explain, and improve.

Start course Start without an account. Sign in to save lesson progress across devices.

Your project

Start with the practice files. Build your project one lesson at a time.

Practice files are free without an account. Sign in to save your project record in My Proof: a description, checklist, and optional work link. Keep the original files in your own app or notebook; saving a project record does not upload them.

  1. Get your materialsDownload practice filesRunnable Python files, expected outputs, five checks, a blank learner record, and instructions for paper practice or execution.
  2. Make your projectView the project checklist Work in your own notebook, document, or software. Use the supplied practice examples when you prefer.
  3. Keep a private recordSave a project record Sign in to save a description and checklist, then return to update them.
Course handbook

Know the route before you begin.

Here’s what you’ll need and what you’ll make. You can return to this guide during any lesson.

Who this is for

Learners age 14 and older, including adults exploring technical work or strengthening school and community projects. No employment or university enrollment is needed.

Prepare before lesson one
  • Choose paper or a plain text editor for your code, expected results, and notes.
  • Use the fictional supply-kit examples in the lessons. The optional starter pack includes runnable files, expected outputs, and a blank learner record.
  • To run the code, use an available Python 3 installation. You can also complete every activity by working through the code on paper.
Your final project

Finish with proof you can use.

Build a supply-kit calculator, check it with five test cases, and explain how to use it. Combine the work you complete across the six lessons.

Save a project record in My Proof
See project checklist and review criteria

Keep your working files in your own notebook or software. Save a private description, checklist, and work link in My Proof.

What to include

  • State numeric input rules and invalid-input behavior.
  • Include a working function, conditional guard and loop over a list.
  • Show original, changed, empty and invalid-input reasoning.
  • Retain five explicit tests with expected results.
  • Provide complete code, expected output and a handoff note.

Review and revise

Use these criteria to check your work and choose what to improve.

  • Correctness: valid quantities produce independently checked kit counts.
  • Reasoning: traces explain assignment, branches and repeated work.
  • Testing: normal and invalid cases support the claimed behavior.
  • Handoff: supported inputs and limitations are clear.
Three ideas to help you along the way
Three useful ideas

The rules behind the steps.

01

Predict first

Write an expected result before running code.

02

Keep inputs visible

Functions should identify the information needed for their result.

03

Prove the small claim

Test the stated contract and name what remains unsupported.

What do these words mean?
Key words

Key terms worth knowing.

Variable
A name referring to a value during execution.
Condition
An expression evaluated to choose a branch.
Loop
Instructions repeated for items or while a condition holds.
Function
A named reusable block accepting inputs and optionally returning a result.
Assertion
A check that stops execution when its stated condition is false.
Your route

6 lessons.
One useful project.

Work in order the first time. Each lesson makes something the next lesson can use.

  1. 1
    Up next

    Read values and predict a program

    Work through each assignment in order, record the values, and predict the labeled result. This step-by-step record is called a trace.

  2. 2
    29 min

    Make a decision with a condition

    Use a threshold and handle its boundary explicitly.

  3. 3
    32 min

    Repeat work across a list

    Trace a loop and accumulate quantities without losing earlier values.

  4. 4
    32 min

    Package a calculation as a function

    Write a function that returns a reusable result from explicit inputs.

  5. 5
    38 min

    Find a bug and check the repair

    Use a failing input to repair validation and repeat meaningful tests.

  6. 6
    42 min

    Finish a small, explainable Python tool

    Combine the guarded function, list processing and test evidence into one usable program.

Use the tools

Tools to help you practice.

See all tools
Source transparency

Sources and further study.

Explore the references behind the lessons and take your learning further. Source notes explain access and reuse.

Harvard CS50 — Introduction to Programming with Python
Source & access notes · checked 2026-09-10

Opened the course overview and Week 0 page; verified coverage of variables, conditionals, loops, exceptions and testing. Optional deeper study, not a source of copied exercises.

Access: OpenCourseWare is free to read/watch. External assignment submission requires an edX account; optional verified/professional certificates use separate enrollment and may cost money. No Harvard affiliation or credit is offered here.

Reuse: Linked for reference. Examples, activities and assessments here are original; free access alone does not grant permission to reuse source text or branding.

Python documentation — An Informal Introduction
Source & access notes · checked 2026-09-10

Opened official Python 3 tutorial; read arithmetic, assignment, strings, lists and indexing sections.

Access: Free public reading; no account or certificate is required for this Life Starter course.

Reuse: Linked for reference. Examples, activities and assessments here are original; free access alone does not grant permission to reuse source text or branding.

Python documentation — More Control Flow Tools
Source & access notes · checked 2026-09-10

Opened official tutorial covering if, for, range and function definitions; examples use stable Python 3 syntax.

Access: Free public reading; no account or certificate is required for this Life Starter course.

Reuse: Linked for reference. Examples, activities and assessments here are original; free access alone does not grant permission to reuse source text or branding.

Ready when you are

Start with the first useful move.

You’ll always know what to do, what to make, and where to go next.

Start lesson one