source: doc/papers/llheap/examples/Fib2.py @ 06601401

Last change on this file since 06601401 was 7bef8cf, checked in by Peter A. Buhr <pabuhr@…>, 18 months ago

start paper on llheap

  • Property mode set to 100644
File size: 271 bytes
Line 
1def Fib():
2    fn1, fn = 1, 0
3    while True:
4        yield fn
5        fn1, fn = fn, fn1 + fn
6
7f1 = Fib()
8f2 = Fib()
9for i in range( 10 ):
10        print( next( f1 ), next( f2 ) )  # resume
11
12# Local Variables: #
13# tab-width: 4 #
14# compile-command: "python3.7 Fib2.py" #
15# End: #
Note: See TracBrowser for help on using the repository browser.