New course! Every coder should learn Generative AI!
Try a free lesson+ 2
What is the difference classmethod and staticmethod?
2 Answers
+ 2
Class Method:
Takes reference to class (cls) instead of an instance (self)
Static Method:
You call it like a normal function ClassName.StaticMethod() without instantciating