Some thougts on cartesian products

Paul Rubin http
Sun Jan 22 12:59:12 EST 2006


aleax at mail.comcast.net (Alex Martelli) writes:
> > given length. You could get a 6/49 lotto tip with something like:
> > choice(set(range(49)).powerset(6))
> 
> And that would be better than the current random.sample(range(49),6) in
> WHAT ways, exactly...?

I think the first one would be incorrect since it samples with
replacement.  At least, it looks like it does.



More information about the Python-list mailing list