Methods-
-A special kind of function that is defined in a class definition.
-In object orientation programming, function is said to be a method.
Syntax for calling a method-
object.method()
program-
#create class
class Computer():
i=10
s="This is class"
def hello(self):
print("hello")
def hii(self):
print("Hii")
def world(self):
print('world')
#create an object
obj=Computer()
print(obj.i)
print(obj.s)
obj.hello()
obj.hii()
obj.world()
10
This is class
hello
Hii
world