[newbie] A question about lists and strings
Rotwang
sg552 at hotmail.co.uk
Fri Aug 10 11:12:20 EDT 2012
On 10/08/2012 10:59, Peter Otten wrote:
> [...]
>
> If you have understood the above here's a little brain teaser:
>
>>>> a = ([1,2,3],)
>>>> a[0] += [4, 5]
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> TypeError: 'tuple' object does not support item assignment
>
>>>> a[0]
>
> What are the contents of a[0] now?
Ha, nice.
--
I have made a thing that superficially resembles music:
http://soundcloud.com/eroneity/we-berated-our-own-crapiness
More information about the Python-list
mailing list