n = 11 symbol = "#" white_space = n - 1 white_space2 = 1 for i in range(1,n+1): for j in range(white_space): print(" ", end="") white_space -= 1 for k in range(i*2 - 1): print(symbol,end="") print() for i in range(n-1,0,-1): for j in range(white_space2): print(" ",end="") white_space2 += 1 for k in range(2 * i - 1): print(symbol,end="") print()
👍
n = 11
symbol = "#"
white_space = n - 1
white_space2 = 1
for i in range(1,n+1):
for j in range(white_space):
print(" ", end="")
white_space -= 1
for k in range(i*2 - 1):
print(symbol,end="")
print()
for i in range(n-1,0,-1):
for j in range(white_space2):
print(" ",end="")
white_space2 += 1
for k in range(2 * i - 1):
print(symbol,end="")
print()
Your Code Works Flawlessly on printing the diamond shape