Answer to Question #225362 in Python for raj

Question #225362

Diamond Crystal

Given an integer value

N, write a program to print a diamond pattern of 2*N rows as shown below.


1
Expert's answer
2021-08-11T14:12:00-0400
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))

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