Nov-20-2019, 12:40 AM
def fib(n): # write Fibonacci series up to n
"""Print a Fibonacci series up to n."""
a = 0
b = 1
while a < n:
print(a, end=' ')
a, b = b, a+b
print()
# Now call the function we just defined:
fib(2000)The output for this function is:0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597
My question is what is the function of the last print() function in the function since it has no arguments to print?
