Floyd's Triangle || Pattern || Python
In this we are going to see how to print the above pattern of right angle triangle of numbers/Floyd's Triangle, using nested for loops in Python Programming Language.


print("\nEnter the number of rows\n", end='')
rows = int(input())
number = 1
print("\n", end='')

for i in range(1, rows + 1):
    for j in range(1, i+1):
        print(number, end='')
        print(" ", end='')
        number += 1
        j += 1
    print("\n", end='')

# Coded by Sahil Shaikh

#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post