5 AnswersNew Answer
HonFu thank you for that very good, simple explanation. You nailed it, and I think I needed to see it written to help me remember the difference. Thank you! Thank you! 😎👍 Manisha thank you for asking the question. I have been struggling on some of the OOP concepts and this helped. 👍
Classmethods AND static methods can be called without an instance. Try this: class C: @classmethod def f(cls): print('Method of', cls) C.f() The main difference is that static methods have no implicit first argument, neither self (the instance) nor cls (the class).
Manisha The main difference is static method can be call without creating the object of class means we can directly access with class.
Manisha while reviewing OOP again and still not fully grasping everthing I found another awesome series on youtube that really made things understandable: https://www.youtube.com/playlist?list=PL-osiE80TeTsqhIuOqKhwlXsIBIdSeYtc There is a video dedicated to class and static methods: https://youtu.be/rq8cL2XMM5M (And thank you SoloLearn for getting me started, but your OOP curriculum could use some rework... a lot of users agree, read the comments. 😉).