r/learnpython
•
u/Current-Vegetable830
•
Jan 13 '26
•
1
I cannot understand Classes and Objects clearly and logically
75
Upvotes
r/learnpython
•
u/Current-Vegetable830
•
Jan 13 '26
•
1
2
u/jackardian Jan 13 '26
Think of an object as a thing. A button, for example.
A thing can do things. A button can be pressed, for example. That's an object's methods (functions your class can do).
A thing can have properties. Your button might have colour (red, let's say), and text ("launch nukes", for example)
To make buttons, there's a mechanism that makes them. A class.
boom_button = class MakeButton(color, text, action)