fib.pyx 193 Bytes
Newer Older
1 2
from __future__ import print_function

3 4 5 6
def fib(n):
    """Print the Fibonacci series up to n."""
    a, b = 0, 1
    while b < n:
7
        print(b, end=' ')
8
        a, b = b, a + b
9 10

    print()