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


Groups > comp.lang.python > #16492

Re: Complete beginner, any help appreciated :) - For Loops

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <pedro.h.souto@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.026
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'beginner': 0.04; 'python': 0.08; 'subject:beginner': 0.09; 'syntax.': 0.09; '"for"': 0.16; '"in"': 0.16; 'general.': 0.16; 'means:': 0.16; 'syntax': 0.16; 'wrote:': 0.18; 'this?': 0.19; 'subject:help': 0.21; 'header:In- Reply-To:1': 0.22; 'hopefully': 0.24; '(in': 0.26; "i'm": 0.26; 'coding': 0.28; 'bit': 0.28; 'elements': 0.29; 'css,': 0.30; 'lot.': 0.30; 'skip:\xc2 20': 0.30; '(the': 0.30; 'thanks': 0.31; 'anyone': 0.31; "i've": 0.31; 'does': 0.32; 'wondering': 0.32; 'list': 0.32; 'message-id:@gmail.com': 0.33; 'header:User- Agent:1': 0.33; 'named': 0.33; 'to:addr:python-list': 0.34; 'question,': 0.34; 'something': 0.35; 'however,': 0.36; 'received:209.85.161': 0.36; 'example,': 0.37; '8bit%:86': 0.37; 'element': 0.37; 'but': 0.37; 'list,': 0.37; 'received:192': 0.37; 'received:google.com': 0.37; 'think': 0.37; 'spent': 0.38; 'received:209.85': 0.38; 'aside': 0.39; 'define': 0.39; 'mark': 0.39; 'help': 0.39; "it's": 0.40; 'received:209': 0.40; 'to:addr:python.org': 0.40; 'received:192.168': 0.40; 'hours': 0.60; 'free': 0.64; 'subject:For': 0.67; '"for': 0.67; '8bit%:100': 0.69; 'subject:any': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=TM36tJLdJovZ8L81p8hYSIeiTrrbjvGf7cd7ZRfl3UM=; b=o4j9dhZ1ic91fNuKQjjMrJkIma1h1jcY7vvqxkvxrXjVBRcv1FajJmlimvDXlKgBhS KZC0fHJfLldzlPEnJZQ5hQDYeE1ksTszBX7uFINKqhMvg/iOg31+pM7W+eefbPPQKfSi vTCE762XR9BFbt21lX2fcT3UJSQB0NY7B57x4=
Date Thu, 01 Dec 2011 09:32:11 -0200
From "Pedro Henrique G. Souto" <pedro.h.souto@gmail.com>
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20111105 Thunderbird/8.0
MIME-Version 1.0
To python-list@python.org
Subject Re: Complete beginner, any help appreciated :) - For Loops
References <5646135.332.1322736831034.JavaMail.geo-discussion-forums@prjr26>
In-Reply-To <5646135.332.1322736831034.JavaMail.geo-discussion-forums@prjr26>
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 8bit
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.3195.1322739143.27778.python-list@python.org> (permalink)
Lines 31
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1322739143 news.xs4all.nl 6968 [2001:888:2000:d::a6]:46314
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:16492

Show key headers only | View raw


On 01/12/2011 08:53, Mark wrote:
> Hi there,
>
> I'm a complete beginner to Python and, aside from HTML and CSS, to coding in general. I've spent a few hours on it and think I understand most of the syntax.
>
> However, I'm wondering a bit about For Loops. I know that the basic syntax for them is to define a list, and then to use something like:
>
> for x in y
>
> However, what does "for" and "in" mean in this context? Can anyone help me to understand this? I know it's a really basic question, but hopefully it will see me on my way to coding properly :)
>
> Thanks a lot.

That means (in a free translation)

"For each one of 'x' in 'y', do this"

'y' is a list, for example, then it means: "For each one of the elements 
of the list 'y' (the element on the current iteration is named 'x'), do 
this"

Good Luck!

Att;
Pedro Henrique G. Souto
<pedro.h.souto@gmail.com>
╔═════════════╗
║ ²²²d○_○b²²² ║
╚═════════════╝

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


Thread

Complete beginner, any help appreciated :) - For Loops Mark <markpackt@gmail.com> - 2011-12-01 02:53 -0800
  Re: Complete beginner, any help appreciated :) - For Loops Laurent Claessens <moky.math@gmail.com> - 2011-12-01 12:14 +0100
  Re: Complete beginner, any help appreciated :) - For Loops "Pedro Henrique G. Souto" <pedro.h.souto@gmail.com> - 2011-12-01 09:32 -0200
  Re: Complete beginner, any help appreciated :) - For Loops Dave Angel <d@davea.name> - 2011-12-01 06:56 -0500
  Re: Complete beginner, any help appreciated :) - For Loops Mark <markpackt@gmail.com> - 2011-12-01 04:15 -0800
  Re: Complete beginner, any help appreciated :) - For Loops Ben Finney <ben+python@benfinney.id.au> - 2011-12-02 00:36 +1100
  Re: Complete beginner, any help appreciated :) - For Loops "Kyle T. Jones" <onexpadREMOVE@EVOMERyahoodotyouknow.com> - 2011-12-01 18:23 -0600

csiph-web