PRINTING FLOYD'S TRIANGLE PATTERN IN PYTHON!!

in #python5 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.

Coin Marketplace

STEEM 0.13
TRX 0.34
JST 0.036
BTC 109207.95
ETH 4399.20
USDT 1.00
SBD 0.84