Question #349972

Given an integer N as input.

Write a program a number diamond of 2*N -1 rows.

No of rows in diamond 5.


The output will be :::

1

1 2

1 2 3

1 2 3 4

1 2 3 4 5

1 2 3 4

1 2 3

1 2

1









Expert's answer

N = int(input('N= '))
for row in range(1, N+1):
    for col in range(1, row+1): 
        print(col, end='')
    print()
for row in range(1, N+1):
    for col in range(1, (N+1) - row): 
        print(col, end='')
    print()

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS