Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news1.tnib.de!feed.news.tnib.de!news.tnib.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'value,': 0.03; 'received :mail-vb0-f46.google.com': 0.09; 'sep': 0.09; 'cc:addr:python- list': 0.10; 'def': 0.10; '24,': 0.16; 'lot!': 0.16; 'subject:which': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'received:209.85.212.46': 0.18; 'all,': 0.21; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header :In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'received:209.85.212': 0.28; 'url:mailman': 0.29; 'code': 0.31; 'url:python': 0.32; 'print': 0.32; 'url:listinfo': 0.32; 'received:google.com': 0.34; 'thanks': 0.34; 'follows:': 0.35; 'pm,': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'url:org': 0.36; "didn't": 0.36; 'should': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'header:Received:5': 0.40; 'url:mail': 0.40; 'think': 0.40; 'results': 0.65; '20,': 0.65; 'dear': 0.66; 'why?': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=IAPxhumisvTFeKzKack4Yhhe9/aMW22BYygn93MGpU0=; b=z0NUtBEXFKl+tlCawNywpkE/2sJ0UM8ZLimuaX2dnrrJgJ4FB7hkz5SXQWv28HvVHa 8WCOR2xJbidg6tE3GL9BY6RblMtjS6MTj3KIi5h4As6lsMpWmcs5nHQuD1HfBIioQl5+ e/YmUGHJl9IxRhBYE/uR+BWbYfdQUIMeiqBBbJDEws71fbJK/EC7Zn0qiFgtaxHcADpQ dJUb980xPOtUSCiREJce7+TxcP9qrFehZ/4X+XPUAGKwG5D9JtMDKjMApVbMmNEDcLqD L17IlUQB0f+oZXPFOZRt5+2fXzzBZFu+z27gv2zYZmN1OmWn4ftx2tz2BCK91fvbs/qt Pf3A== MIME-Version: 1.0 In-Reply-To: <95e88ca6-36ad-4820-8ecc-c9a788517430@googlegroups.com> References: <95e88ca6-36ad-4820-8ecc-c9a788517430@googlegroups.com> Date: Mon, 24 Sep 2012 19:57:27 -0400 Subject: Re: which a is used? From: Dwight Hutto To: Jayden Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1348531049 news.xs4all.nl 6888 [2001:888:2000:d::a6]:33250 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29969 On Mon, Sep 24, 2012 at 7:43 PM, Jayden wrote: > Dear All, > > I have a simple code as follows: > > # Begin > a = 1 > > def f(): > print a > > def g(): > a = 20 > f() > > g() > #End > > I think the results should be 20, but it is 1. Would you please tell me why? > > Thanks a lot! > > -- > http://mail.python.org/mailman/listinfo/python-list didn't return the value, or print it out -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com