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/Pure-Willingness-697 Oct 09 '26
Classes are useful if you want to make a package to do somthing as they let to use things like decorators and storing values with self
They also let you take advantage of the with statement