Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #25883

What's wrong with this code?

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <viewfromoffice@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.188
X-Spam-Level *
X-Spam-Evidence '*H*': 0.63; '*S*': 0.01; 'subject:code': 0.07; 'gui': 0.11; 'received:209.85.214.174': 0.21; 'question': 0.27; 'message-id:@mail.gmail.com': 0.27; "i'm": 0.29; 'code': 0.31; 'print': 0.32; 'to:addr:python-list': 0.33; 'code:': 0.33; 'received:google.com': 0.34; 'thanks': 0.34; 'subject:?': 0.35; 'received:209.85': 0.35; 'totally': 0.36; 'subject:with': 0.36; 'received:209': 0.37; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'header:Received:5': 0.40; 'virus:src="cid:': 0.64; 'content-type:multipart/related': 0.65; 'as:': 0.75; 'subject:this': 0.84; 'image-size:2**9': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-goomoji-body:date:message-id:subject:from:to :content-type; bh=CtO1ErcftcsAw+k96xpBmluLJsaTx5HIwDJ8IUqiLe8=; b=ky1hXXqKMuOSImghVf3x/opkddFWnatDM7QZAyWRqR5u+lb8Kkkag4r9wK/eRm7TnA ckMkNw9KzPTf3dYCYNmoRFeVqxE8rqtF6ZtNZUm+XKhh4XJiCD0e1R7AvV28crZcVV1H ZuLpEFMkr6UIc13vBk0bGVwZx8rTMYG5KX8pHSMQMV9lwsMrUiq9K8DXZJquUlqtxm2j BQYRwn+jeNnGpYbl9XBN4sqk1KsFd2L3dm25oYP839AUGUoM7ehIh/eglLR6oZi1Hv/t UuqMMVFpSuINnpCZkbc4L4w0jGArcQd/Wq/B2zH6APlON47bUK6pJbnyEEvBV+j7GpOv khJA==
MIME-Version 1.0
X-Goomoji-Body true
Date Mon, 23 Jul 2012 22:50:03 +0800
Subject What's wrong with this code?
From Stone Li <viewfromoffice@gmail.com>
To python-list@python.org
Content-Type multipart/related; boundary=e89a8f839b0b6dc7cb04c5805cb5
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2478.1343055006.4697.python-list@python.org> (permalink)
Lines 88
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1343055006 news.xs4all.nl 6952 [2001:888:2000:d::a6]:51507
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:25883

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

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[?]

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

What's wrong with this code? Stone Li <viewfromoffice@gmail.com> - 2012-07-23 22:50 +0800
  Re: What's wrong with this code? Andrew Cooper <amc96@cam.ac.uk> - 2012-07-24 02:19 +0100
    Re: What's wrong with this code? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-07-24 07:23 +0100
    Re: What's wrong with this code? Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-07-24 03:38 -0400
    Re: What's wrong with this code? Ian Kelly <ian.g.kelly@gmail.com> - 2012-07-24 02:26 -0600
  Re: What's wrong with this code? Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-07-24 09:47 +0200
    Re: What's wrong with this code? Chris Angelico <rosuav@gmail.com> - 2012-07-24 18:24 +1000
      Re: What's wrong with this code? Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-07-24 12:05 +0200
    Re: What's wrong with this code? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-24 08:26 +0000
    Re: What's wrong with this code? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-07-24 11:34 +0200
  Re: What's wrong with this code? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-07-24 10:34 +0200

csiph-web