Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!news.tele.dk!news.tele.dk!small.news.tele.dk!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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python.': 0.02; 'tutorial': 0.03; 'variables': 0.07; 'subject:question': 0.10; 'cc:addr:python-list': 0.11; 'python': 0.11; '24,': 0.16; 'be:': 0.16; 'wrote:': 0.18; 'do.': 0.18; 'trying': 0.19; 'email addr:gmail.com>': 0.22; 'python?': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'lets': 0.24; 'cc:2**0': 0.24; 'handling': 0.26; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; '(on': 0.31; 'this.': 0.32; 'python.org': 0.32; 'stuff': 0.32; 'url:python': 0.33; 'sense': 0.34; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'var': 0.36; 'url:listinfo': 0.36; 'url:org': 0.36; 'little': 0.38; 'url:mail': 0.40; 'how': 0.40; 'numbers': 0.61; 'first': 0.61; 'to:addr:gmail.com': 0.65; 'started.': 0.68; 'results': 0.69; 'joel': 0.91; '2013': 0.98 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=GBJZIJVJuf9VObOS03Q1yZgCHHo1+Sph+8n0YiPD1+o=; b=jeNJdCwmS3kK2raz+pm6TnazqfVL3YM3exOb7Z2QP4DnC/h5lMbRm9LOaOgF1+HqaB R1RGKrfh0a9+regwxI68OFhPjnCGOOSSnx6a2IWS7OPNDJ9gQ6Ix4euRs4CEduGH2OaP 7ZDJKCKIqzm6/ExlD8ykiBexM+JrCXpdK8xsgXLogQzQKSo+WrTe/zYcSadtkx9B+qFm XOTj9kVJ9vYH4xmz1DimIrKSCfqctOswkG+FmtDKqXYLQ/Ax6OXNU31zkqxsM5wFBs9S nwZ837qpOru24MJVcOuXkXwUfFXml9tPlG8hB8qxzqnOkXNhI9/U4KLtIOy0JC9Y4NWE 5K0g== MIME-Version: 1.0 X-Received: by 10.52.72.227 with SMTP id g3mr16862vdv.93.1387902046807; Tue, 24 Dec 2013 08:20:46 -0800 (PST) In-Reply-To: <9ad01eef-baf0-4018-833e-0b4dce4b9b85@googlegroups.com> References: <9ad01eef-baf0-4018-833e-0b4dce4b9b85@googlegroups.com> Date: Tue, 24 Dec 2013 11:20:46 -0500 Subject: Re: Variables in a loop, Newby question From: Joel Goldstick To: vanommen.robert@gmail.com Content-Type: multipart/alternative; boundary=bcaec50165257c444204ee4a2098 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: 99 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387902055 news.xs4all.nl 2966 [2001:888:2000:d::a6]:44511 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62681 --bcaec50165257c444204ee4a2098 Content-Type: text/plain; charset=UTF-8 On Tue, Dec 24, 2013 at 11:07 AM, wrote: > Hello, for the first time I'm trying te create a little Python program. > (on a raspberri Pi) > > I don't understand the handling of variables in a loop with Python. > > > Lets say i want something like this. > > x = 1 > while x <> 10 > var x = x > x = x + 1 > > The results must be: > > var1 = 1 > var2 = 2 > > enz. until var9 = 9 > > How do i program this in python? > -- > https://mail.python.org/mailman/listinfo/python-list > You might want to go to python.org and check out the documentation. I don't really understand what you are trying to do. The var1, var2 stuff doesn't make sense In python you can loop like this: for x in range(10): print x This will print the numbers from 0 to 9. But your best bet is to find a brief tutorial to get started. -- Joel Goldstick http://joelgoldstick.com --bcaec50165257c444204ee4a2098 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable



On Tue, Dec 24, 2013 at 11:07 AM, <vanommen.robert@gmail.= com> wrote:
Hello, for the first time I'm trying te = create a little Python program. (on a raspberri Pi)

I don't understand the handling of variables in a loop with Python.


Lets say i want something like this.

x =3D 1
while x <> 10
=C2=A0 =C2=A0 =C2=A0 =C2=A0 var x =3D x
=C2=A0 =C2=A0 =C2=A0 =C2=A0 x =3D x + 1

The results must be:

var1 =3D 1
var2 =3D 2

enz. until var9 =3D 9

How do i program this in python?
--
https://mail.python.org/mailman/listinfo/python-list

You m= ight want to go to python.org and check o= ut the documentation.=C2=A0 I don't really understand what you are tryi= ng to do.=C2=A0 The var1, var2 stuff doesn't make sense

In python you can loop like this:
<= br>
for x in range(10):
=C2=A0 print x

Thi= s will print the numbers from 0 to 9.

But your best bet is to find a brief t= utorial to get started.
=C2=A0


--
--bcaec50165257c444204ee4a2098--