r/pythonhelp • • Aug 27 '26

Why do I need to use classes

My schoolbook says that classes is a way of simulating an object, instead of just taking information into a black box and outputting an answer.

But that is a poor explanation. I know classes are handy and cool, but no book says why you can´t make functions with sub functions inside to simulate simple objects. I would like if someone gave a good concrete reason to use classes in the intro, instead of just saying that they are different and cool

2 Upvotes

31 comments sorted by

View all comments

Show parent comment

2

u/dbu8554 Aug 27 '26

So fascinating hearing a class described this way.

I've read papers on folks that speak more than one language, or understanding linguistics being adept at programming but I've never encountered it myself.

Fascinating.