What's wrong with this code?

Stone Li viewfromoffice at gmail.com
Mon Jul 23 10:50:03 EDT 2012


I'm totally confused by this code:

Code:

> a = None
> b = None
> c = None
> d = None
> x = [[a,b],
>      [c,d]]
> e,f = x[1]
> print e,f
> c = 1
> d = 2
> print e,f
> e = 1
> f = 2
> print c,d
>
> Output:

None None
> None None
> 1 2
>


I'm expecting the code as:

> None None
> 1 2
> 1 2
>
>

What's wrong?
And this question made my GUI program totally out of control.
Thanks[?]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120723/4191aa45/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 338.gif
Type: image/gif
Size: 541 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20120723/4191aa45/attachment.gif>


More information about the Python-list mailing list