1#Objects can also contain methods. Methods in objects are functions that belong to the object.
2#Let us create a method in the Person class:
3
4class Person:
5
6 def __init__(self, name, age):
7 self.name = name
8 self.age = age
9
10 def myfunc(self): # This is a method
11 print("Hello my name is " + self.name)
12
13p1 = Person("John", 36)
14p1.myfunc()