Skip to content

Commit 6b865f7

Browse files
authored
Create pyramidpattern55.py
1 parent cefc765 commit 6b865f7

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Pyramid Patterns/pyramidpattern55.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
height = int(input())
2+
3+
for i in range(1,height):
4+
5+
for j in range(height-i,1,-1):
6+
print(end=" ")
7+
8+
for j in range(height-i-1,height-1):
9+
print(j,end=" ")
10+
11+
print()
12+
13+
for i in range(1,height):
14+
15+
for j in range(1,i+1):
16+
print(end=" ")
17+
18+
for j in range(height-i,1,-1):
19+
print(height-j,end=" ")
20+
21+
print()
22+
23+
# Sample Input :- 5
24+
# Output :-
25+
# 3
26+
# 2 3
27+
# 1 2 3
28+
# 0 1 2 3
29+
# 1 2 3
30+
# 2 3
31+
# 3

0 commit comments

Comments
 (0)