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


Groups > comp.lang.python > #93190

Re: Can anybody explain the '-' in a 2-D creation code?

X-FeedAbuse http://nntpfeed.proxad.net/abuse.pl feeded by 78.192.65.63
Path csiph.com!usenet.pasdenom.info!nntpfeed.proxad.net!news.muarf.org!news.roellig-ltd.de!open-news-network.org!border2.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <atnakus.arzah@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.049
X-Spam-Evidence '*H*': 0.90; '*S*': 0.00; 'subject:code': 0.07; 'python.': 0.11; 'thu,': 0.15; '>in': 0.16; 'wrote:': 0.16; 'variable': 0.20; '2015': 0.23; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; '-0700,': 0.29; 'tutorial': 0.29; 'work.': 0.30; 'me?': 0.34; 'subject:?': 0.34; 'received:google.com': 0.34; 'could': 0.35; 'to:addr:python-list': 0.35; 'skip:> 10': 0.35; "isn't": 0.35; 'but': 0.36; 'there': 0.36; 'should': 0.37; 'subject:: ': 0.37; 'to:addr:python.org': 0.39; 'subject:-': 0.39; 'subject:the': 0.40; 'content- disposition:inline': 0.60; 'unclear': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=KwpFG88WPnZ6Y+E37hNR1zaDhVh9XTjmgf3Wvw3bhiQ=; b=eTXCaYJS5jTXV4zwPZVzD83Vq2J4B3dyQ8tzTmTA0oMVhU99q0NVuAkvGc5/MLFeLZ zwK730lGw5Fpuk6Ut6YEVsdm9onsJWI6vK04Rkk+W2t1xekEs8wNh8+xmp4OUVvsVXb7 fC+8KSKWw4kxkf1YIIjIJ1z5SqZ3IC7mUikhIqlrE7KiUxyHui20oT/cUznDWM6oJSSw 7sN9V/QObRdeXP5PhGpUBaCkO7RVtOpgUig8apc9LRzjX1pGGMe+h8Z7oXZVM28DcdVY 6GNhRkX3RSmbL6D7pJNl3VMKqPXx6tVQxJYQALLHSoU77bS59NUlVTbM4iZG+LJIFuOi fX+g==
X-Received by 10.66.132.81 with SMTP id os17mr96622516pab.153.1435282171687; Thu, 25 Jun 2015 18:29:31 -0700 (PDT)
Date Thu, 25 Jun 2015 18:29:28 -0700
From Atnakus Arzah <atnakus.arzah@gmail.com>
To python-list@python.org
Subject Re: Can anybody explain the '-' in a 2-D creation code?
Mail-Followup-To python-list@python.org
References <e90e10c2-6762-4636-9e05-1f96c7c0b2c2@googlegroups.com>
MIME-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Disposition inline
In-Reply-To <e90e10c2-6762-4636-9e05-1f96c7c0b2c2@googlegroups.com>
User-Agent Mutt/1.5.23 (2014-03-12)
X-Mailman-Approved-At Fri, 26 Jun 2015 09:09:20 +0200
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.103.1435302561.3674.python-list@python.org> (permalink)
Lines 23
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1435302561 news.xs4all.nl 2850 [2001:888:2000:d::a6]:43744
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:93190

Show key headers only | View raw


On Thu, Jun 25, 2015 at 06:07:30PM -0700, fl wrote:
>Hi,
>
>I read Ned's tutorial on Python. It is very interesting. On its last
>example, I cannot understand the '_' in:
>
>
>
>board=[[0]*8 for _ in range(8)]
>
>
>I know  '_' is the precious answer, but it is still unclear what it is
>in the above line. Can you explain it to me?

Its just a variable whose value isn't used in this specific expression, you could use 'x', 'y', or any other valid variable
name there and it should work.


-- 
Atnakus Arzah <atnakus.arzah@gmail.com>

When in doubt, have a cookie!

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


Thread

Can anybody explain the '-' in a 2-D creation code? fl <rxjwg98@gmail.com> - 2015-06-25 18:07 -0700
  Re: Can anybody explain the '-' in a 2-D creation code? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-26 02:23 +0100
    Re: Can anybody explain the '-' in a 2-D creation code? fl <rxjwg98@gmail.com> - 2015-06-25 18:40 -0700
      Re: Can anybody explain the '-' in a 2-D creation code? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-26 03:27 +0100
  Re: Can anybody explain the '-' in a 2-D creation code? André Roberge <andre.roberge@gmail.com> - 2015-06-25 18:24 -0700
  Re: Can anybody explain the '-' in a 2-D creation code? Atnakus Arzah <atnakus.arzah@gmail.com> - 2015-06-25 18:29 -0700
  Re: Can anybody explain the '-' in a 2-D creation code? Gary Herron <gary.herron@islandtraining.com> - 2015-06-25 18:18 -0700

csiph-web