Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

fibonacci sequence python

def fib(n):
    a = 0
    b = 1

    print(a)    
    print(b)

    for i in range(2, n):
        print(a+b)
        a, b = b, a + b

fib(7) #first seven nubers of Fibonacci sequence
Source by # #
 
PREVIOUS NEXT
Tagged: #fibonacci #sequence #python
ADD COMMENT
Topic
Name
7+4 =