Diamond Crystal
Given an integer value
N, write a program to print a diamond pattern of 2*N rows as shown below.
n = int(input())
for i in range(1, n + 1):
print(' '.join(['*'] * i).rjust(n + i - 1))
for i in range(n, 0, -1):
print(' '.join(['*'] * i).rjust(n + i - 1))
Comments
Leave a comment