Nested loop limit?

Dan Christensen jdc at uwo.ca
Sat Jul 10 22:40:57 EDT 2004


Peter Hansen <peter at engcorp.com> writes:

>  >>> for n in range(100):
> ...   exec '\n'.join([(' ' * i) + 'for i%s in range(2):' % i for i in
> range(n)])
>   + '\n' + ' ' * n + 'pass\n'

To tie two threads together, I shudder to think of how unreadable
python code could be if there was a ternary operator.  :-)

Dan



More information about the Python-list mailing list