Tuples part 2

George Sakkis george.sakkis at gmail.com
Thu Jun 5 15:41:32 CEST 2008


On Jun 5, 9:26 am, "victor.hera... at gmail.com"
<victor.hera... at gmail.com> wrote:
> On Jun 5, 1:37 am, bearophileH... at lycos.com wrote:
>
>
>
> > victor.hera... at gmail.com:
>
> > Do you mean something like this? (notice the many formatting
> > differences, use a formatting similar to this one in your code)
>
> > coords = []
>
> > for i in xrange(1, 5):
> >     for j in xrange(1, 5):
> >         for k in xrange(1, 2):
> >             coords.append( (i, j, k) )
>
> > coords *= 10
> > print coords
>
> > Bye,
> > bearophile
>
> Hi,
>
> the result i would like is similar to a set of n tuples: tuple_1,
> tuple_2,...,tuple_n. I use h in order to enumerate the tuples and
> i,j,k would be the coordinates.

>From the pseudocode you wrote at first, tuple_1, tuple_2, ..., tuple_n
would be all equal. Is this intentional, and if so, what's the
purpose ?

George



More information about the Python-list mailing list