Answer to Question #225220 in Python for Reclimet

Question #225220

Diamond Crystal


This Program name is Diamond Crystal. Write a Python program to Diamond Crystal, it has two test cases


The below link contains Diamond Crystal question, explanation and test cases


https://docs.google.com/document/d/1sVH8M0vCCSky84V1PkWD-eKm1v0dPRC5/edit?usp=sharing&ouid=104486799211107564921&rtpof=true&sd=true


We need exact output when the code was run

1
Expert's answer
2021-08-14T01:39:58-0400
row = int(input())
for i in range(1, row+1):
    for j in range(1,row-i+1):
        print(" ", end="")
    for j in range(1, 2*i):
        if j==1 or j==2*i-1:
            print("/", end="")
        else:
            print(" ", end="")
    print()


for i in range(row-1,0, -1):
    for j in range(1,row-i+1):
        print(" ", end="")
    for j in range(1, 2*i):
        if j==1 or j==2*i-1:
            print("/", end="")
        else:
            print(" ", 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