DEV Community

Vinoth Kumar
Vinoth Kumar

Posted on

PATTERN PROGRAM

Q1)

for num in range(6,1,-1):
    for col in range(1,num): #1 2 3 4 5
        print(num-col, end=' ')
    print()

Enter fullscreen mode Exit fullscreen mode

OUTPUT :

Q2)

for row in range(6,1,-1):
    for col in range(row-1,0,-1):
        print(col, end=' ')
    print()

Enter fullscreen mode Exit fullscreen mode

OUTPUT :

Top comments (0)