Find duplicates in a list and count them ...

Josh Dukes josh.dukes at microvu.com
Thu Mar 26 20:55:12 EDT 2009


On Thu, 26 Mar 2009 16:02:20 -0400
"D'Arcy J.M. Cain" <darcy at druid.net> wrote:

or 
l = ( randint(0,9) for x in xrange(80000) )

> On Thu, 26 Mar 2009 16:00:01 -0400
> Albert Hopkins <marduk at letterboxes.org> wrote:
> > > l = list()
> > > for i in xrange(80000):
> > >     l.append(randint(0,10))
> >       ^^^^^^^^^^^^^^^^^^^^^^^
> > should have been:
> >       l.append(randint(0,9))
> 
> Or even:
> 
>   l = [randint(0,9) for x in xrange(80000)]
> 


-- 

Josh Dukes
MicroVu IT Department



More information about the Python-list mailing list