Beta

Sync to cloud

Uses your current signed-in YoolVi account. A Learn profile is not required.

Upload a snapshot of this browser’s saved lesson work across all subjects, including notes, experiments, journal and review history. Existing guest work is included only when you confirm below. This does not upload account credentials or award XP.

Sync uploads to your private account; it does not automatically merge or replace this device’s work. On another device, download the cloud copy and use My Learning’s backup import. The previous cloud snapshot is retained when a new one replaces it.

Export or import this device’s work

No background uploads. Edits made after a snapshot need another sync. On shared devices, work is bound to the first account observed by cloud sync; another account must use a separate browser profile. Keep your own downloaded backup too.

Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Back to Programming for AI: Make It Run

Make a Failure Useful

A bug is behavior that violates a stated rule. A test supplies an input, an expected result and a comparison. A traceback identifies where Python failed; the final exception explains the immediate failure, not necessarily its original cause.

Why does one passing example miss a bug?

Authored explanation · fixed examples, not a live experiment.

  1. Rule: multiply quantity by price

  2. Counterexample (2, 3): expected 6, observed 5

  3. Repair operator, rerun old and new tests

Why does one passing example miss a bug? Name the evidence for your answer.

By the end of this lesson

Use a failing test and a minimal counterexample to repair a calculation.

Start this lesson

Inside the lesson

  1. See why a test misses a bug
  2. Choose a counterexample
  3. Repair and test the function
  4. Explain your repair
  5. Test a different calculation
  6. Keep failures useful

The reproducibility tasks require running the supplied Python starter. Setup instructions and examples are included.