Skip to content

Commit

Permalink
Merge pull request sourabhjagtap95#36 from Harshalszz/master
Browse files Browse the repository at this point in the history
Added Palindromic Pyramid Pattern
  • Loading branch information
sourabhjagtap95 authored Oct 15, 2020
2 parents cf31241 + f6d4fa4 commit 1403a9d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Palindromic_Pyramid.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Python program for Palindrome pyramid pattern printing using numbers
n = int(input("Enter the number of rows : "))
for i in range(1,n+1, +1):
for j in range(1,i+1 ,+1):
print(j , end=" ");
for h in range((i-1),0,-1):
print(h, end = " ")
print(end = "\n")

"""Ouput:
Enter the number of rows : 8
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1
1 2 3 4 5 6 5 4 3 2 1
1 2 3 4 5 6 7 6 5 4 3 2 1
1 2 3 4 5 6 7 8 7 6 5 4 3 2 1
"""

0 comments on commit 1403a9d

Please # to comment.