Coding Nested Loops

Rich Shepard rshepard at
Sat Sep 16 19:06:25 CEST 2006

On Sat, 16 Sep 2006, Dan Sommers wrote:

> When you import random, all you're doing is importing the module; you have
> to specify any given attribute thereof:


   I thought that was implied. For example, I use 'import wx' and can then
instantiate wx.frame, wx.dialogbox, etc. without explicitly importing each
one. Apparently different modules work differently.

>> ... 2) What are the differences between 'choice' and 'shuffle?'

> choice chooses one element of a given list and leaves the list itself
> alone; shuffle shuffles the list, presumably so that you can iterate
> through the elements yourself.

   OK. The former picks the element for you while with the latter we must
specify which element to pick.

   Thank you. This is all very good to know.


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

More information about the Python-list mailing list