본문 바로가기

Python

Python_G-010. class vs instance

G-010_Class_Instance.py
0.00MB

  Class Instance
Definition Blueprint for creating objects An individual object created from a class
Attributes Defines attributes Contains data specific to the instance
Methods Defines methods Can use the class-defined methods
Example class Dog: my_dog = Dog("Buddy", 3)
Usage Used to define structure and behavior Used to create objects that follow the class blueprint