I did not understand the behavior of array multiplication. In fact, I
just now learned what it was called thanks to your email.
Best wishes,
Rafael
On Mon, Jul 11, 2011 at 9:33 AM, Brett Ritter wrote:
> On Mon, Jul 11, 2011 at 9:26 AM, Rafael Turner
> wrote:
>> I am playing lists and dictionari
On Mon, Jul 11, 2011 at 9:26 AM, Rafael Turner
wrote:
> I am playing lists and dictionaries and I came across this
> counter-intuitive result.
>
d = dict(zip(['a', 'q', 'c', 'b', 'e', 'd', 'g', 'j'],8*[[0]]))
...
d['a'].__setitem__(0,4)
...
>
> I was not expecting all the keys to be upda
Hi,
On 11 July 2011 14:26, Rafael Turner wrote:
>
> >>> d = dict(zip(['a', 'q', 'c', 'b', 'e', 'd', 'g', 'j'],8*[[0]]))
> >>>d
> Out:
> {'a': [0],
> 'b': [0],
> 'c': [0],
> 'd': [0],
> 'e': [0],
> 'g': [0],
> 'j': [0],
> 'q': [0]}
>
> >>> d['a'].__setitem__(0,4)
> >>> d
> Out:
> {'a': [4]
Hello,
I am playing lists and dictionaries and I came across this
counter-intuitive result.
>>> d = dict(zip(['a', 'q', 'c', 'b', 'e', 'd', 'g', 'j'],8*[[0]]))
>>>d
Out:
{'a': [0],
'b': [0],
'c': [0],
'd': [0],
'e': [0],
'g': [0],
'j': [0],
'q': [0]}
>>> d['a'].__setitem__(0,4)
>>> d
Out: