Fibonacci series in Python

Fibonacci Sequence is the series of numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, ... The next number is found by adding up the two numbers before it.

Source code :

def Fibonacci(n):
    
    a, b = 0, 1
    
    for x in range(0,n):
        print(a)
        a, b = b, a + b 
    
Fibonacci(10) # Change the number here

Output :

0
1
1
2
3
5
8
13
21
34

Output :


                

Comments :