Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python fibonacci

# Call fib(range) for loop iteration
def fib(rng):
  a, b, c = 0, 1, 0
  for i in range(rng):
    c = a + b; a = b; b = c
    print(a)
fib(10)
Source by # #
 
PREVIOUS NEXT
Tagged: #python #fibonacci
ADD COMMENT
Topic
Name
9+2 =