Answer to Question #349972 in Python for Arkadeep Kundu

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









1
Expert's answer
2022-06-13T08:29:29-0400
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS