E.Nurminski wrote (off the list):
> the intention was to have
>
> newx = [1, 2]
> res = [[1, 2]]
> newx = [1, 3]
> res = [[1, 2], [1, 3]]
> newx = [1, 4]
> res = [[1, 2], [1, 3], [1, 4]]
> newx = [1, 5]
> res = [[1, 2], [1, 3], [1, 4], [1, 5]]
> newx = [1, 6]
> res = [[1, 2], [1, 3], [1, 4], [1,
E.Nurminski wrote:
> Hello to all good people
>
> I am new to the great Py so am quite puzzled by the following code
>
> ---
>
> res = []
> x = [ 1, 1 ]
> for i in xrange(0,5):
> res.append(x)
> x[1] = x[1] + 1
> print "x = ", x
> print "res = ", res
>
>
E.Nurminski wrote:
> Hello to all good people
>
> I am new to the great Py so am quite puzzled by the following code
>
> ---
>
> res = []
> x = [ 1, 1 ]
> for i in xrange(0,5):
> res.append(x)
> x[1] = x[1] + 1
> print "x = ", x
> print "res = ", res
>
>
E.Nurminski wrote:
> Hello to all good people
>
> I am new to the great Py so am quite puzzled by the following code
>
> ---
>
> res = []
> x = [ 1, 1 ]
> for i in xrange(0,5):
> res.append(x)
> x[1] = x[1] + 1
> print "x = ", x
> print "res = ", res
>
>
Hello to all good people
I am new to the great Py so am quite puzzled by the following code
---
res = []
x = [ 1, 1 ]
for i in xrange(0,5):
res.append(x)
x[1] = x[1] + 1
print "x = ", x
print "res = ", res
---
Looks like it puts smth lik