[Tutor] methods and functions
Gerardo Arnaez
garnaez@yahoo.com
Fri Jun 13 12:29:02 2003
--- Lloyd Kvam <pythontutor@venix.com> wrote:
A method is essentially a function
> defined within a class body.
Than is an instance method just passing an some other
class instace thorught another class instances' method
ie
class A:
def __init__ (self,A):
self.name=A
def printIt(self):
print self.name
class B:
def __init__ (self):
pass
a=A('Aay')
b=B()
a.name
'Aay'
a.printIt
'Aay'
So what does
a.name(b) do?
Is this an instance method?
Is how a method differs from a function?
G
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com