5.4-2 繰り返しの中でyield文を使う
def method2(start, stop):
n = start
while n < stop:
yield n
n += 1
fo n in method2(0, 5):
print(n)
->
0
1
2
3
4
5
def method2(start, stop):
n = start
while n < stop:
yield n
n += 1
fo n in method2(0, 5):
print(n)
->
0
1
2
3
4
5