Selecting elements from a list

Mel Wilson mwilson at the-wire.com
Fri Sep 5 16:20:01 CEST 2003


In article <bj9c2d$87g$05$1 at news.t-online.com>,
"Michael Peuser" <mpeuser at web.de> wrote:
>from random import random
>rowA1 =[random()]*100000; rowA2=[random()]*100000

   Note, though, that each of these would get you 100000
copies of a particular randomly-chosen number.

rowA1 = [random() for i in xrange (100000)]

will give differing numbers.

        Regards.        Mel.




More information about the Python-list mailing list