new in programing
James Stroud
jstroud at mbi.ucla.edu
Fri Dec 9 16:45:55 EST 2005
More information about the Python-list mailing list
Fri Dec 9 16:45:55 EST 2005
- Previous message (by thread): new in programing
- Next message (by thread): new in programing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Cameron Laird wrote: > In article <mailman.1914.1134158780.18701.python-list at python.org>, > Mike C. Fletcher <mcfletch at vrplumber.com> wrote: > >>Python iterates over "things" (objects), of which integer numbers are >>just one possible choice. The range built-in command produces ranges of >>integers which are useful for tasks such as this. >> [...clip (something that begs of recursion)...] > I don't think the list comprehension helps, in this case--although > it hints at the temptation of an eval-able expression which is > briefer. More on that, later. This goes backwards. Going forwards is left as an exercise for whomever: def do_something(*args): print args def do_deeply(first, depth, lim, todo, inc, *args): if depth < lim: do_deeply(first+inc, depth+inc, lim, todo, inc, *args) if first < depth: do_deeply(first+inc, depth, lim, todo, inc, *args + (first,)) else: do_something(*args) do_deeply(first=1, depth=6, lim=8, todo=do_something, inc=1) James
- Previous message (by thread): new in programing
- Next message (by thread): new in programing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list