On Sun, 03 Feb 2008 05:33:16 -0800, Ivan Illarionov wrote:

> Plain Python function are very often more powerful than classes:
> 
>>>> def go(count):
> ...   if not hasattr(go, 'count'):
> ...     go.count = count
> ...   if go.count <= 0:
> ...     del go.count
> ...     return False
> ...   go.count -= 1
> ...   return True
> ...
>>>> while go(3):
> ...   print 'hello'
> ...
> hello
> hello
> hello
>>>>

Please try:

while go(3):
    while go(3):
        print 'Think about it...'

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to