Concept of Class, Method and Objects
Class The class can be defined as a collection of objects. It is a logical entity that has some specific attributes and methods. For example: if you have an employee class, then it should contain an attribute and method, i.e. an email id, name, age, salary, etc. Syntax for creating Class class ClassName: {Statement Here} Let's go through the example Suppose Employee is a class. Employee Has an atttributes Name, email, Address and Salary. class Employee: # Here __init__() is a constructor.Constructors are generally used for instantiating an object. The task of constructors is to initialize(assign values) to the data members of the class when an object of class is created. In Python the __init__() method is called the constructor and is always called when an object is created. def __init__(self): Objects The object is an entity that has state and behavior. It may be any real-world object like the mouse, keyboard, chair, tab...