Recursive generator in Python 3.5

tpqnnd01 at gmail.com tpqnnd01 at gmail.com
Mon Oct 31 10:50:20 EDT 2016


Hi Chris,
Please see the exampl I just got it below, this is the Tower of Hanoi with recursive generator but it do not have the 'return' here, do you have the advice for this term:
def A001511():
 yield 1
 b=1
 for x in A001511():
 yield x+1
 yield 1
trial=A001511()
for i in range(10):
 a=next(trial)
 print(a)


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /