MemotivaObject-oriented programming

What is the difference between a class and an instance?

Object-oriented programming

Audio flashcard · 0:14

Nortren·

What is the difference between a class and an instance?

0:14

A class defines structure and behavior. An instance is a concrete object created from the class, with its own data. A single class can have many instances. Class attributes are shared across all instances, while instance attributes are unique to each instance.
docs.python.org