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
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()
Comments
Leave a comment