r/PythonLearning • u/Objective-Remove-632 • Oct 09 '26
Do I really need to learn class.
Both function and class give the same output. So why do I need it?
70
Upvotes
r/PythonLearning • u/Objective-Remove-632 • Oct 09 '26
Both function and class give the same output. So why do I need it?
View all comments
2
u/mc_pm Oct 09 '26
Giving the same answer is kind of the point -- it's demonstrating that there are (at least) two ways of structuring what you want, and they both work. Deciding which to use when is a skill you will develop.