Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: raise exception within generator
Post: RE: raise exception within generator

Thanks for the reply. According to the link below one has to handle any StopIteration exceptions one generates within the generator itself. If one does not and lets the exception bubble out from the ...
bermudj General Coding Help 3 2,990 Jun-06-2020, 09:51 AM
    Thread: raise exception within generator
Post: raise exception within generator

Hi, I have a generator def myRange(start, end): while start < end: yield start start += 1 raise StopIteration for n in myRange(2, 5): print(n)I get a runtime erro...
bermudj General Coding Help 3 2,990 May-24-2020, 04:23 PM
    Thread: use for without in
Post: RE: use for without in

So when "in" is used in a for, the "in" is not the in operator that gives a True or False value. Am I correct?
bermudj General Coding Help 6 25,365 May-14-2020, 12:58 PM
    Thread: use for without in
Post: RE: use for without in

Thank you. It's now clear.
bermudj General Coding Help 6 25,365 May-09-2020, 02:30 PM
    Thread: use for without in
Post: use for without in

Hi, Are there situations where one can use a for without an in? Usually the for loop is for x in whatever: ..... I get the impression that "for" must always be used with the "in" keyword. Is this ...
bermudj General Coding Help 6 25,365 May-09-2020, 10:33 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020