Python Program to print a kajukatri shape
n=7
spc=n*2+1
for row in range(1,n+1):
x=''
x=' '*spc
for col in range(1,row+1):
x=x+str(col)+' '
for col in range(row-1,0,-1):
x=x+str(col)+' '
print(x)
spc=spc-2
spc=spc+4
for row in range(n-1,0,-1):
x=''
x=' '*spc
for col in range(1,row+1):
x=x+'* '
for col in range(row-1,0,-1):
x=x+'* '
print(x)
spc=spc+2
Comments
Post a Comment