rf-web/vendor/bundle/gems/rouge-3.12.0/lib/rouge/demos/python

7 lines
164 B
Plaintext
Raw Normal View History

2019-10-21 08:18:17 +00:00
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