[Tutor] Re: More Class Help.

Michael Chermside mcherm@destiny.com
Tue, 20 Aug 2002 11:25:08 -0400


S A wrote:
> Hi Everyone-
> 
> Let's say I have the following made up class:
> 
> class MadeUp:
>     def __init__(self, x, y, z):
>         self.x = x
>         self.y = y
>         self.z = z
> 
>     def xData(self, x):
>         ... do some stuf here...
>     def yData(self, y):
>         ... do some stuf here...
>     def zData(self, z):
>         ... do some stuf here...
> 
> Would this allow a person to pass along the variables (x,y,z) to the the "MadeUp" instance?

Yes. They're available as "self.x", "self.y", and "self.z"


> Would this also allow someone to pass the variables along to each of the class methods?

Yes. They're available as "x", "y", and "z" (although only one is 
available in each method).

-- Michael Chermside