Diamond Pattern


        

Diamond: 

n=int(input())

t=n
k=0
while(t!=0):
    
    
    
    print("*"*(t-1),end="")
    print("."*(n-t+1+k),end="")
    print("*"*(t-1),end="")
    print()
    t-=1
    k+=1
    
t=1
k=((n-1)*2)-1
while(t!=n):
    
    
    
    print("*"*(t),end="")
    print("."*(k),end="")
    print("*"*(t),end="")
    print()
    t+=1
    k-=2


output:






  


Comments

Popular posts from this blog

Trouble with the Number System

Residue Arithmetic

Perfect Peak of Array