Tuples part 2
victor.herasme at gmail.com
victor.herasme at gmail.com
Thu Jun 5 09:26:08 EDT 2008
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. Maybe something like:
tuple_1=((a,b,c),..,(n,n,n))
.
.
.
tuple_n=((d,e,f),..,(n,n,n))
I hope u can help me with that.
Victor
More information about the Python-list
mailing list