Python - 073 : Class Variables in python
ฝัง
- เผยแพร่เมื่อ 4 ต.ค. 2024
- Python » Python Object-Oriented Programming (OOP) » Python Class Variables
Python Class Variables
Updated on: February 7, 2022 | 7 Comments
In Object-oriented programming, when we design a class, we use instance variables and class variables.
In Class, attributes can be defined into two parts:
Instance variables: If the value of a variable varies from object to object, then such variables are called instance variables.
Class Variables: A class variable is a variable that is declared inside of class, but outside of any instance method or __init__() method.