Lie Ryan [EMAIL PROTECTED] writes:
On Mon, 20 Oct 2008 12:34:11 +0200, Hrvoje Niksic wrote:
Michele [EMAIL PROTECTED] writes:
Hi there,
I'm relative new to Python and I discovered that there's one single way
to cycle over an integer variable with for: for i in range(0,10,1)
Please use
Hi there,
I'm relative new to Python and I discovered that there's one single way
to cycle over an integer variable with for:
for i in range(0,10,1)
which is equivalent to:
for (i = 0; i 10; i++)
However, how this C statement will be translated in Python?
for (j = i = 0; i (1 H); i++)
On Mon, Oct 20, 2008 at 2:56 AM, Michele [EMAIL PROTECTED] wrote:
Hi there,
I'm relative new to Python and I discovered that there's one single way
to cycle over an integer variable with for:
for i in range(0,10,1)
Actually, you want:
for i in range(10):
Since starting at 0 and using a step
Michele [EMAIL PROTECTED] writes:
Hi there,
I'm relative new to Python and I discovered that there's one single way
to cycle over an integer variable with for:
for i in range(0,10,1)
Please use xrange for this purpose, especially with larger
iterations. range actually allocates a sequence.
On Mon, 20 Oct 2008 12:34:11 +0200, Hrvoje Niksic wrote:
Michele [EMAIL PROTECTED] writes:
Hi there,
I'm relative new to Python and I discovered that there's one single way
to cycle over an integer variable with for: for i in range(0,10,1)
Please use xrange for this purpose, especially
Lie Ryan wrote:
(which might be the more typical case). And I think range will be an
iterator in the future, imitating the behavior of xrange. So it doesn't
really matter anyway.
In 3.0, range is a class and range(arg) is a re-iterable instance of
that class.
a = range(10,2,-3)
a
On Mon, 20 Oct 2008 17:01:13 +, Lie Ryan wrote:
On Mon, 20 Oct 2008 12:34:11 +0200, Hrvoje Niksic wrote:
Michele [EMAIL PROTECTED] writes:
Hi there,
I'm relative new to Python and I discovered that there's one single
way to cycle over an integer variable with for: for i in