Classes in Python programming is a building block that leads to OOP. It is user-defined data type which combines data and methods for manipulating that data into one package.
class cls: #'cls' is name of Class.
def fun(self): #'fun()' is name of function.
print("This is Function")
def fun2(self): #'fun2()' is name of function.
print("This is Another Function")
obj = cls() #'obj' is object of class 'cls'.
obj.fun() #with the help of object 'obj' calling 'fun()' function.
obj.fun2() #with the help of object 'obj' calling 'fun2()' function.
#Note: U also Write like 'class cls():',
# And 'self' is not Keyword in Functions.
class cls: #'cls' is name of Class.
def fun(self): #'fun()' is name of function.
print("This is Function")
def fun2(self): #'fun2()' is name of function.
print("This is Another Function")
obj = cls() #'obj' is object of class 'cls'.
obj2 = cls() #'obj2' is another object of class 'cls'.
obj.fun() #with the help of object 'obj' calling 'fun()' function.
obj2.fun2() #with the help of object 'obj2' calling 'fun2()' function.
class cls: #'cls' is name of Class.
def set(self): #this is function.
self.a = input("Enter value for a: ") #assigning values to 'a'
self.b = input("Enter value for b: ") #and 'b'.
def put(self): #this is another function.
print("a is: ",self.a) #printing 'a' and
print("b is: ",self.b) #'b' value.
obj = cls() #'obj' is object of class 'cls'.
obj.set() #calling 'set()' function.
obj.put() #calling 'put()' function.