[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: help on object  programing
From:       Neil Cerutti <horpner () yahoo ! com>
Date:       2007-08-17 18:38:08
Message-ID: slrnfcbqf2.1jc.horpner () FIAD06 ! norwich ! edu
[Download RAW message or body]

On 2007-08-17, yadin <conra2004@yahoo.com> wrote:
> class big(self):
>
>     x = 32
>     list = []
>     def inside (self):
>
>         class small(self): # a new class defined inside the first
>
>             y = 348
>             list.append(y) # send the value to first list
>             list.append(x)
>
> print list
>
> how can i define my variables so that there are valid outside
> the class???

Be sure to read and try the code in the sections of the Python
tutorial that discuss classes and the objects they create.

In my opinion the classes section of the official tutorial is
unfortunately the least tutorial part of the tutorial. But it
won't steer you wrong.

-- 
Neil Cerutti
-- 
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic