×
FREE ASSISTANCE FOR THE INQUISITIVE PEOPLE
Tutorial Topics
X
softetechnologies
Use of capitalize() and split() use of replace() function
Pattern 04 - Python Language
2528    Arnab De    06/01/2021

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

softetechnologies
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()
softetechnologies
Use of capitalize() and split() use of replace() function
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.
Enter New Comment
Comment History
No Comment Found Yet.
Sri Sri Ramakrishna Paramahamsa
The world is needed a mixture of truth and make-believe. Discard the make-believe and take the truth.
Sri Sri Ramakrishna Paramahamsa
6469
89.24
Today So Far
Total View (Lakh)
softetechnologies
26/05/2018     55349
25/06/2018     46450
01/01/2018     44446
28/06/2017     42122
02/08/2017     41252
01/08/2017     35137
06/07/2017     34905
15/05/2017     34043
11/09/2018     32091
14/07/2017     31141
softetechnologies