strange append
E.Nurminski
nurmi at dvo.ru
Mon Oct 2 00:49:05 EDT 2006
More information about the Python-list mailing list
Mon Oct 2 00:49:05 EDT 2006
- Previous message (by thread): ANN: Urwid 0.9.7 - Console UI Library
- Next message (by thread): strange append
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 like reference to 'x' into 'res' list, instead of value. But if I want a value should I use a different method or what ? Evgeni P.S. Could not easily find the issue in the manual/tutorial can you point me out to smth relevant ?
- Previous message (by thread): ANN: Urwid 0.9.7 - Console UI Library
- Next message (by thread): strange append
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list