We have already discussed that classes/objects can have methods just like functions except
that we have an extra self variable. We will now see an example.
Example 11.2. Using Object Methods
class Person:
def sayHi(self):
print 'Hello, how are you?'
p = Person()
p.sayHi()
$ python method.py
Hello, how are you?
Here we see the self in action. Notice that the
sayHi method takes no parameters but still has the
self in the function definition.