# Methods are callable functions that perform an operation on the object. # Attributes and methods of an object can be accessed using the dot '.' syntax:
class test(object): def printNum(self): print self.num
t = test() t.num = 4 t.printNum()
Related Scripts with Example Source Code in same category :