Re: [Tutor] 'for' iteration stop problem

2011-04-02 Thread Steven D'Aprano
Mateusz Koryciński wrote: I have some problem with 'for' loop in algorithm. Code and description for this problem could be find here: http://stackoverflow.com/questions/5520145/how-to-stop-iteration-when-if-statement-is-true Other people have answered your question about exiting nested loops, b

Re: [Tutor] 'for' iteration stop problem

2011-04-02 Thread Wayne Werner
On Sat, Apr 2, 2011 at 5:45 PM, Alan Gauld wrote: > > There are other ways but those should cover most eventualities. I find that my preferred way when the loops are nested is to move the loops into a function and then return: def do_something(collection, collection2): for x in collection:

Re: [Tutor] 'for' iteration stop problem

2011-04-02 Thread Alan Gauld
"Mateusz Korycinski" wrote My problem is simple for sure, but unfortunately I'm a bit beginner and I've stucked in it. I hope it is not a problem since as I understand this mailing list is for beginners. No problem, we try to answer questions such as this here. I have some problem with '

[Tutor] 'for' iteration stop problem

2011-04-02 Thread Mateusz Koryciński
Hi, My problem is simple for sure, but unfortunately I'm a bit beginner and I've stucked in it. I hope it is not a problem since as I understand this mailing list is for beginners. I have some problem with 'for' loop in algorithm. Code and description for this problem could be find here: http://st