how many nested for can we utilize?

Patrol Sun sunp1028 at gmail.com
Sun Aug 17 21:08:52 EDT 2008


Yes, I can solve the problem by recursive function. I guess Function Call
consume more resources than nested For. So I use the nested For by using
exec function.

2008/8/18 Paul Boddie <paul at boddie.org.uk>

> On 17 Aug, 19:36, Fredrik Lundh <fred... at pythonware.com> wrote:
> >
> > and functions will solve the 40-billion year computation problem exactly
> > how?
>
> I was thinking more about the need to nest "for" statements to a depth
> of 20 levels, which I imagine only arises on a "just in case" basis
> for the inquirer. In other words, the inquirer may have input that
> could theoretically demand twenty levels of state, each level provided
> by a single "for" statement, but in practice they might only need to
> manage a few levels of state.
>
> In any case, we're potentially seeing the use of the wrong tool for
> the job, and I am speculating that functions would be the right tool,
> but unless the inquirer is willing to show the code (which I haven't
> seen in this thread yet), it's hard to speculate further.
>
> Paul
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080818/4f44c5c8/attachment-0001.html>


More information about the Python-list mailing list