Franciso, some more code.
Breaking with two conditions, and fun with exceptions:
moflo = 1
try:
for item1 in range(10):
if (item1 * moflo) == 3: raise StopIteration
for item2 in range(10):
if (item2 * moflo) == 2: raise StopIteration
print "Let's see"
except StopIteration:
As you know is not functional...
It represents something that happens everyday on Python programming.
We can reduce the other examples of code to:
prinf foo
Too. :)
--
http://mail.python.org/mailman/listinfo/python-list
Well facundo, I knew that you were going for the return inside the
loop.
The exception is cool, but not for newcomers.
My proposend code is simpler clearer and more compact, I keep watching
your code, and don't know
Funcs for breaking loops, exceptions for breaking loops.
:o
--
http://mail.p
>And that could be modified even further, using current
>(unextended) Python...
Nice code Wulfraed (or Dennis), back to the basics:
-- Your code
foo = 0
for item1 in range(10):
for item2 in range(10):
foo = item1 + item2
if foo == 2:
print "Let's see"
break # let's go
if (
>Still, this can be acomplished with the break statement, in a more
>clear way, with less variables (which implies less work for the gc and
>everybody).
Glad to read from you Francisco. :) Keep up that hard work, thanks.
I have been talking with those Python programmers (And Role players),
:) and
Hi My name is Juan Carlos Rodrigo, and I love Python.
It is the most impressive and usefull language that
I have ever seen.
I am studing, at http://www.uoc.edu, an Information
Technology Postgraduate. And I have programmed some
REXX applications in my past Jobs (So I love python,
no more ENDS).
*