7 lines
164 B
Plaintext
7 lines
164 B
Plaintext
|
def fib(n): # write Fibonacci series up to n
|
||
|
"""Print a Fibonacci series up to n."""
|
||
|
a, b = 0, 1
|
||
|
while a < n:
|
||
|
print a,
|
||
|
a, b = b, a+b
|