Skip to content

Commit f5f7178

Browse files
authored
Create pyramidpattern75.py
1 parent 23efbf6 commit f5f7178

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Pyramid Patterns/pyramidpattern75.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
height = int(input())
2+
k = height-1
3+
x = 1
4+
y = 1
5+
6+
for i in range(1,height+1):
7+
8+
for j in range(1,k+1):
9+
print(end=" ")
10+
11+
for j in range(1,i*2):
12+
13+
if(i%2 != 0):
14+
print(x,end=" ")
15+
x += 1
16+
17+
if(x >9):
18+
x = 1
19+
20+
else:
21+
c = chr(y+64)
22+
print(c,end=" ")
23+
y += 1
24+
25+
k -= 1
26+
print()
27+
28+
# Sample Input :- 5
29+
# Output :-
30+
# 1
31+
# A B C
32+
# 2 3 4 5 6
33+
# D E F G H I J
34+
# 7 8 9 1 2 3 4 5 6

0 commit comments

Comments
 (0)