Nested loops, cross products, and so on (was: new in programing)

2005-12-16 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Dan Bishop <[EMAIL PROTECTED]> wrote: >Cameron Laird wrote: >... >> for hextuple in [(i, j, k, l, m, n) >> for i in range(1, lim + 1) \ >> for j in range (1, lim + 2) \ >> for k in range (1, lim + 3) \ >> for l in range (1, lim +

Re: new in programing

2005-12-09 Thread James Stroud
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Mike C. Fletcher <[EMAIL PROTECTED]> wrote: > >>Python iterates over "things" (objects), of which integer numbers are >>just one possible choice. The range built-in command produces ranges of >>integers which are useful for tasks such as

Re: new in programing

2005-12-09 Thread Dan Bishop
Cameron Laird wrote: ... > for hextuple in [(i, j, k, l, m, n) > for i in range(1, lim + 1) \ > for j in range (1, lim + 2) \ > for k in range (1, lim + 3) \ > for l in range (1, lim + 4) \ > for m in range (1, lim + 5) \ > for n in range (1,

Re: new in programing

2005-12-09 Thread James Stroud
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Mike C. Fletcher <[EMAIL PROTECTED]> wrote: > >>Python iterates over "things" (objects), of which integer numbers are >>just one possible choice. The range built-in command produces ranges of >>integers which are useful for tasks such as

Re: new in programing

2005-12-09 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Mike C. Fletcher <[EMAIL PROTECTED]> wrote: >Python iterates over "things" (objects), of which integer numbers are >just one possible choice. The range built-in command produces ranges of >integers which are useful for tasks such as this. > >lim = 3 > >for i in ra

Re: new in programing

2005-12-09 Thread Mike C. Fletcher
Python iterates over "things" (objects), of which integer numbers are just one possible choice. The range built-in command produces ranges of integers which are useful for tasks such as this. lim = 3 for i in range( 1, lim+1 ): for j in range( i+1, lim+2): for k in range( j+1, lim+

Re: new in programing

2005-12-09 Thread Brett Hoerner
Efrain Marrero wrote: > i want to now how to do this in python > this is java > > > for(int i=1 ; i<=lim ; i++){ > > for(int j=i+1; j<=lim+1; j++){ > > for(int k =j+1; k<=lim+2;k++){ > > for(int l=k+1 ; l<=lim+3;l++){ > >

new in programing

2005-12-09 Thread Efrain Marrero
i want to now how to do this in python this is java for(int i=1 ; i<=lim ; i++){ for(int j=i+1; j<=lim+1; j++){ for(int k =j+1; k<=lim+2;k++){