Coding Nested Loops

Rich Shepard rshepard at appl-ecosys.com
Sat Sep 16 11:29:26 EDT 2006


On Sat, 16 Sep 2006, Peter Otten wrote:

> As George hinted, I went a bit over the top with my itertools example.
> Here is a translation into static lists (mostly):

Peter,

   Thank you. This is clearer to me. While your original code certainly works
it reminded me of The C Users Journal's annual obfuscated C contests. :-)

> from random import choice

   Two questions germane to random: 1) Why wasn't choice available when I
used 'import random,' and 2) What are the differences between 'choice' and
'shuffle?'

> Of course nested loops will work, too. Use whatever you find easiest to
> maintain.

   I found the library page and will continue looking for more comprehensive
documentation.

Rich

-- 
Richard B. Shepard, Ph.D.               |    The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)    |            Accelerator
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863



More information about the Python-list mailing list