PRINTING FLOYD'S TRIANGLE PATTERN IN PYTHON!!

Words
18
Reading
1 min
Listen
Play
7y

Number=int(input("Enter the number of rows to be printed: "))
first=1
for row in range (1,Number+1):
    for col in range (1, row+1):
        print(first,end=" ")
        first=first+1
    print()

A sample output as executed by me is as follows:

Screenshot_2.png

Copy/paste this code and run it online here.

PRINTING FLOYD'S TRIANGLE PATTERN IN PYTHON!! | Ecency