PRINTING FLOYD'S TRIANGLE PATTERN IN PYTHON!!

in #python6 years ago

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.

Sort:  
UpvoteBank
Your upvote bank
__2.jpgThis post have been upvoted by the @UpvoteBank service. Want to know more and receive "free" upvotes click here