Re: Iterating through a list. Upon condition I want to move on to next item in list

2017-05-10 Thread breamoreboy
On Wednesday, May 10, 2017 at 8:25:25 PM UTC+1, aaron.m@gmail.com wrote: You've all ready had some answers, but are you after something like this? for elem in mylist: if someThing(elem) is True: continue. Kindest regards. Mark Lawrence. --

Re: Iterating through a list. Upon condition I want to move on to next item in list

2017-05-10 Thread Chris Angelico
On Thu, May 11, 2017 at 8:41 AM, Dan Stromberg wrote: > On Wed, May 10, 2017 at 1:46 PM, MRAB wrote: > >> NEVER use a 'bare except' to suppress exceptions! It'll catch _all_ >> exceptions, even NameError (if you've misspelled a name, it'll catch

Re: Iterating through a list. Upon condition I want to move on to next item in list

2017-05-10 Thread Erik
On 10/05/17 23:41, Dan Stromberg wrote: On Wed, May 10, 2017 at 1:46 PM, MRAB wrote: NEVER use a 'bare except' to suppress exceptions! It'll catch _all_ exceptions, even NameError (if you've misspelled a name, it'll catch that too). Catch only those exceptions that

Re: Iterating through a list. Upon condition I want to move on to next item in list

2017-05-10 Thread Dan Stromberg
On Wed, May 10, 2017 at 1:46 PM, MRAB wrote: > NEVER use a 'bare except' to suppress exceptions! It'll catch _all_ > exceptions, even NameError (if you've misspelled a name, it'll catch that > too). Catch only those exceptions that you're prepared to deal with. When

Re: Iterating through a list. Upon condition I want to move on to next item in list

2017-05-10 Thread MRAB
On 2017-05-10 20:25, aaron.m.weisb...@gmail.com wrote: Good afternoon, I have a list that I'm iterating thorough in Python. Each item in the list will have between 1-200 urls associated with it. My goal is to move on to the next. I have a variable "associationsCount" that is counting the

Re: Iterating through a list. Upon condition I want to move on to next item in list

2017-05-10 Thread Erik
On 10/05/17 20:25, aaron.m.weisb...@gmail.com wrote: As my code stands right now, it counts through the stateList[0] and then when associationsCount gets to 0 it just stops. I know I need to add another couple lines of code to get it back going again It's very difficult to see what you're

Iterating through a list. Upon condition I want to move on to next item in list

2017-05-10 Thread aaron . m . weisberg
Good afternoon, I have a list that I'm iterating thorough in Python. Each item in the list will have between 1-200 urls associated with it. My goal is to move on to the next. I have a variable "associationsCount" that is counting the number of urls and once it gets to 0 i want to move on to