Why do we need a class in Python?

Classes provide a means of bundling data and functionality together . Creating a new class creates a new type of object, allowing new instances of that type to be made. Each class instance can have attributes attached to it for maintaining its state.

Sizin İçin Seçtik  What is the difference between class and structure with example?

Leave a Reply

Your email address will not be published. Required fields are marked *