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: 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 --e89a8f839b0b6dc7cb04c5805cb5 Content-Type: multipart/alternative; boundary=e89a8f839b0b6dc7c704c5805cb4 --e89a8f839b0b6dc7c704c5805cb4 Content-Type: text/plain; charset=ISO-8859-1 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[?] --e89a8f839b0b6dc7c704c5805cb4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I'm totally confused by this code:

Code:
a =3D None
b =3D None
c =3D None
d = =3D None
x =3D [[a,b],
=A0=A0=A0=A0 [c,d]]
e,f =3D x[1]
print e,f
c =3D = 1
d =3D 2
print e,f
e =3D 1
f =3D 2
print c,d

Output:

None None
None None
1 2
= =A0

I'm expecting the code as:
None None
1 2
1 2
=A0

What's wrong?
And this question made my GU= I program totally out of control.
Thanks
--e89a8f839b0b6dc7c704c5805cb4-- --e89a8f839b0b6dc7cb04c5805cb5 Content-Type: image/gif; name="338.gif" Content-Transfer-Encoding: base64 X-Attachment-Id: 338@goomoji.gmail Content-ID: <338@goomoji.gmail> R0lGODlhDAAMAKIGAF5LAJh3AP/zxAAAANyuAP/gaP///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh +QQFZAAGACwAAAAADAAMAAADJmi03CowyiWKvZeWMSy32rd1hYZh5gkSVQFY79q6saxm7A0qTW8k ACH5BAUUAAYALAIAAwAIAAYAAAMMWFOsvq/JSYMN07YEACH5BAUUAAYALAMABwAGAAMAAAMIGLq0 QYVImAAAIfkEBRQABgAsAgACAAgABQAAAwtYU6y+r8k5g70lAQAh+QQFFAAGACwCAAIACAAFAAAD CVi6O+xQRUZrAgAh+QQFFAAGACwCAAIACAAFAAADC1hTrL6vyTmDvSUBACH5BAUUAAYALAIAAgAI AAUAAAMJWLo77FBFRmsCACH5BAUUAAYALAIAAgAIAAUAAAMLWFOsvq/JOYO9JQEAIfkEBRQABgAs AgACAAgABQAAAwlYujvsUEVGawIAIfkEBRQABgAsAgACAAgABQAAAwtYU6y+r8k5g70lAQAh+QQF FAAGACwCAAIACAAFAAADCVi6O+xQRUZrAgAh+QQFFAAGACwCAAIACAAFAAADC1hTrL6vyTmDvSUB ACH5BAUUAAYALAIAAgAIAAUAAAMJWLo77FBFRmsCACH5BAUUAAYALAMABwAGAAMAAAMHWLZWvs+9 BAAh+QQFFAAGACwEAAcABAACAAADBAhVCpoAOw== --e89a8f839b0b6dc7cb04c5805cb5--