Re: Problem with lists

2015-09-16 Thread Rafael David
Em terça-feira, 15 de setembro de 2015 21:47:10 UTC-3, Chris Angelico escreveu: > On Wed, Sep 16, 2015 at 10:29 AM, Rafael David wrote: > > Oooohhh ... I think I got it! I'm assigning a reference to peca and not the > > value itself! Thank you very much MRAB and C Smith for the enlightenment :)

Re: Problem with lists

2015-09-15 Thread Chris Angelico
On Wed, Sep 16, 2015 at 10:29 AM, Rafael David wrote: > Oooohhh ... I think I got it! I'm assigning a reference to peca and not the > value itself! Thank you very much MRAB and C Smith for the enlightenment :) Right! That's how Python's assignment always works. You may find, in your case, that y

Re: Problem with lists

2015-09-15 Thread Rafael David
Em terça-feira, 15 de setembro de 2015 21:11:38 UTC-3, MRAB escreveu: > On 2015-09-16 00:45, Rafael David wrote: > > Hi guys, > > > > I'm newbie in Python (but not a newbie developer). I'm facing a > > problem with a bidimensional list (list of lists) containing > > dictionaries. I don't know if I

Re: Problem with lists

2015-09-15 Thread MRAB
On 2015-09-16 00:45, Rafael David wrote: Hi guys, I'm newbie in Python (but not a newbie developer). I'm facing a problem with a bidimensional list (list of lists) containing dictionaries. I don't know if I didn't understand how lists and dictionaries work in Python or if there is a mistake in m

Re: Problem with lists

2015-09-15 Thread C Smith
>>tabuleiro[lin][col] = peca use peca.copy() here or else a deep copy is made. On Tue, Sep 15, 2015 at 4:45 PM, Rafael David wrote: > Hi guys, > > I'm newbie in Python (but not a newbie developer). I'm facing a problem with > a bidimensional list (list of lists) containing dictionaries. I don't

Re: Problem with lists.

2009-02-22 Thread Matimus
On Feb 20, 8:12 am, "ssd" wrote: > Hi, > > In the following code, (in Python 2.5) > I was expecting to get in "b" variable the values  b: [[0, 0], [0, 1],[0, > 2], [0, 3],[0, 4], [1, 0],[1, 1], [1, 2], .] > But I get only the last value [4,4], b: b: [[4, 4], [4, 4], [4, 4], ... ] > > My code:

Re: Problem with lists.

2009-02-22 Thread Chris Rebert
On Fri, Feb 20, 2009 at 8:12 AM, ssd wrote: > > Hi, > > In the following code, (in Python 2.5) > I was expecting to get in "b" variable the values b: [[0, 0], [0, 1],[0, > 2], [0, 3],[0, 4], [1, 0],[1, 1], [1, 2], .] > But I get only the last value [4,4], b: b: [[4, 4], [4, 4], [4, 4], ... ]

Re: Problem with lists.

2009-02-22 Thread des...@gmail.com
On Feb 20, 10:12 am, "ssd" wrote: > Hi, > > In the following code, (in Python 2.5) > I was expecting to get in "b" variable the values  b: [[0, 0], [0, 1],[0, > 2], [0, 3],[0, 4], [1, 0],[1, 1], [1, 2], .] > But I get only the last value [4,4], b: b: [[4, 4], [4, 4], [4, 4], ... ] > > My code: