On Wed, Feb 3, 2010 at 5:26 AM, David <[email protected]> wrote:
> Hello Eike,
>
> thanks for the explanation, all this is really helpful -- I certainly have
> learned sth. today!
> I wonder, though, how I would get my number pairs, which I need later on,
> if I were to follow your solution. I am asking because as I understand your
> code, the list terms is a list of integers here, but not of x,y pairs,
> right? (I can see that this was a problem of my code right from the start,
> btw.)
>
> David
I'll refer you to what I posted in (what appeared to me as) your other
thread:
If you want the unique pairs (i.e. (12,7) is equivalent to (7,12)), I
*think* you can do a simple chain:
pool = []
for x in xrange(1,13):
for y in xrange(x, 13):
pool.append((x,y))
because that will give you the sets ordered by the smallest - you'll get
1x1-12, then 2x2-12, etc.
HTH,
Wayne
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor