Fibonacci Series with Python

Fibonacci Series

 Fibonacci Series are the numbers in the following integer sequence, called the Fibonacci series , and characterized by the fact that every number after the first two is the sum of the two preceding ones:-
      Often, especially in modern usage, the sequence is extended by one more initial term:
By definition, the first two numbers in the Fibonacci sequence are either 1 and 1, or 0 and 1, depending on the chosen starting point of the sequence, and each subsequent number is the sum of the previous two.

<PROGRAM>


def fibo():
    a=int(0)
    b=int(1)
    list=[]
    list.append(a)
    list.append(b)
    for i in range(2,5):
        k=a+b
        list.append(k)
        a=k
        b=a

    print list


fibo()

Comments

Popular posts from this blog

Network File System