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