def pattern(n):
k = 2*n-2
for i in range(0, n):
for j in range(0, k):
print(end=" ")
k = k-1
for j in range(0, i + 1):
print(" " , end="")
print("
")
k=n-2
for i in range(n, -1, -1):
for j in range(k, 0, -1):
print(end=" ")
k=k+1
for j in range(0, i+1):
print("*" , end="")
print("
")
pattern(5)
h = eval(input("Enter diamond's height: "))
for x in range(h):
print(" " * (h - x), "*" * (2*x + 1))
for x in range(h - 2, -1, -1):
print(" " * (h - x), "*" * (2*x + 1))
#OUTPUT
# Enter diamond's height: 4
# *
# ***
# *****
# *******
# *****
# ***
# *