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
1
u/Tall-Introduction414 Jan 13 '26
Do you understand C Structs? You make a struct type, and create "instances" of that struct type.
A class is just a struct with some functions attached to it, called methods. When you create an instance of that class, that instance is called an object.
Td-da. Classes and objects made easy.
Another way of describing this is that the variables are "state" and the methods are "behavior." So, classes are a way of storing state and behavior under a single identifier.