Python · Lesson 12.7 · Pro

Designing a small class

When a class helps, when a function is enough, and how to build one step by step.

In this lesson

  1. Start with a function
  2. A class that keeps state
  3. Build an inventory, step by step
  4. Put it together