Python Program to Print Right Triangle of Fibonacci Series Numbers Pattern

Write a Python program to print right triangle of Fibonacci series numbers pattern using for loop.

rows = int(input("Enter Right Triangle of Fibonacci Numbers Rows = "))

print("====Right Angled Triangle of Fibonacci Series Numbers Pattern====")

for i in range(1, rows + 1):
    First_Value = 0
    Second_Value = 1
    for j in range(1, i + 1):
        Next = First_Value + Second_Value
        print(Next, end = ' ')
        First_Value = Second_Value
        Second_Value = Next
    print()
Python Program to Print Right Triangle of Fibonacci Series Numbers Pattern

This Python program prints the right angled triangle of numbers in the Fibonacci series pattern using a while loop.

rows = int(input("Enter Right Triangle of Fibonacci Numbers Rows = "))

print("===Right Angled Triangle of Fibonacci Series Numbers Pattern====")
i = 1

while(i <= rows):
    First_Value = 0
    Second_Value = 1
    j = 1
    while(j <= i):
        Next = First_Value + Second_Value
        print(Next, end = ' ')
        First_Value = Second_Value
        Second_Value = Next
        j = j + 1
    print()
    i = i + 1
Enter Right Triangle of Fibonacci Numbers Rows = 12
===Right Angled Triangle of Fibonacci Series Numbers Pattern====
1 
1 2 
1 2 3 
1 2 3 5 
1 2 3 5 8 
1 2 3 5 8 13 
1 2 3 5 8 13 21 
1 2 3 5 8 13 21 34 
1 2 3 5 8 13 21 34 55 
1 2 3 5 8 13 21 34 55 89 
1 2 3 5 8 13 21 34 55 89 144 
1 2 3 5 8 13 21 34 55 89 144 233 

About Suresh

Suresh is the founder of TutorialGateway and a freelance software developer. He specialized in Designing and Developing Windows and Web applications. The experience he gained in Programming and BI integration, and reporting tools translates into this blog. You can find him on Facebook or Twitter.