Class:
Class, which is an abstraction of a group of objects with the same properties and methods.
A stricter definition of a class is a cohesive package that consists of a particular kind of meta-data. It describes the rules of behavior of some objects, which are known as instances of the class. Classes have interfaces and structures. Interfaces describe how methods interoperate with classes and their instances, and structs describe how data in an instance is divided into multiple properties.
Object:
An object is an instantiation of a class that refers to something specific.
Object: An object has its own state, behavior, and unique identity; the structure and behavior of all objects of the same type are defined in their common class.
State: Includes properties that are already present in the object (usually defined in the class), plus the current property values that the object has (often dynamic)
Behavior (behavior): Refers to how an object affects the outside world and is influenced by the outside world, and manifests itself as the change of the state of the object and the transmission of information.
Identity: Refers to an object that has a property that differs from all other objects. (essentially the address of an object created in memory)
Classes and objects have properties and methods
In cases where the referenced data type is immutable, the class property is not affected by the object property, which means that the property of the object changes without affecting the class property.
However, the class property affects the object property because the object is instantiated by the class, the Class property is changed, and the object properties are changed.
If a property refers to a mutable data type, either a class or an instance of a property change can affect the other party.
If you add a class property, the instance object also adds a property of the same name and data. Adding properties to an instance object does not affect class properties.
Simple comprehension and summary of Python classes and objects