Python POOP: static, class methods
https://www.youtube.com/watch?app=desktop&v=rq8cL2XMM5M
You want to create a method that applies to every instantiated object in class "Employee"
@classmethod #keyword
def raise_everyone(cls, amount):
cls.raise_amount = amount
To use:
Employee.raise_amount = 1.05
Comments
Post a Comment