Python OOP Class vs Static Methods

💻 Daily Python Question class Test: x = 10 @classmethod def show(cls): return cls.x @staticmethod def display(): return Test.x print(Test.show(), Test.display()) 👇 Output kya hoga? A: 10 10 B: Error C: None None D: 10 Error 👉 Answer: 10 10 Concept: ✔ Classmethod → class access ✔ Staticmethod → direct access 🚀 OOP clear = next level coding #Python #OOP #Coding #Developers #Programming

  • graphical user interface

“Classmethod vs Staticmethod — clear hai?”

Like
Reply

To view or add a comment, sign in

Explore content categories