-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
Description
https://docs.python.org/3/tutorial/controlflow.html#defining-functions
This is the example:
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, end=' ')
a, b = b, a+b
print()
# Now call the function we just defined:
fib(2000)
But this example writes Fibonacci series less than n, not up to n.