Pattern 04 - Python Language
softetechnologies
06-01-2021    106 times
python language pattern

Write a program in python language to create the following pattern.

n=int(input("Enter the no of row : "))
for r in range(1,n+1):
    p=r
    fl=0
    for s in range(1,n-r+1):
        print(" ",end='') 
    for c in range(1,(2*r)):
        print(p,end='')
        if p==1:
            fl=1
        if fl==1:
            p=p+1
        else:
            p=p-1
        
    print()
Private Teacher
softetechnologies
softetechnologies
    Author Details
Arnab De
I have over 16 years of experience working as an IT professional, ranging from teaching at my own institute to being a computer faculty at different leading institute across Kolkata. I also work as a web developer and designer, having worked for renowned companies and brand. Through tutorialathome, I wish to share my years of knowledge with the readers.
    Related Post
  Query About the post