Пример #1
0
import series

for i in series.adder():
    print i

    if i >= 3:
        break
Пример #2
0
import series					#import

for i in series.adder():		#go through the generator
    print i						#print

    if i > 2:					#print after 3 iterations
        break
Пример #3
0
import series #1

for i in series.adder(): #2,5,8
    print i #3,6,9

    if i > 2: #4,7,10
        break #11
Пример #4
0
import series

#for i in series.adder():
#    print i
print series.adder()
print series.adder()
print series.adder()


#    if i > 2:
#        break
Пример #5
0
import series  # import series.py

for i in series.adder():  # use the adder class and iterater over it (runs for forever)
    print i  # print i (our adder object)

    if i >= 3:  # once we have done this three times quit
        break