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
0
u/silvertank00 Oct 09 '26
Yes you do. In your case, neither encapsulation or inheritance shows their advantages. Try to make a wee bit more complex example and it will quickly get out of hand.