given an integer value N as input write a program to print a shaded diamond of 2 *N -1 rows using an asterisk characters
n=int(input("Please input n:"))
num=2*n-1
for i in range(1, num+1):
i = i - (num//2 +1)
if i < 0:
i = -i
print(" " * i + "*" * (num - i*2) + " "*i)
Comments
Leave a comment