Skip to content

Commit e92305e

Browse files
authored
Create alphabeticpattern25.py
1 parent 67026d4 commit e92305e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
def pypart2(n):
2+
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3+
k = 2*n - 2
4+
flag = n-1
5+
for i in range(0, n):
6+
for j in range(0, k):
7+
print(end=" ")
8+
k = k - 2
9+
counter = flag
10+
for j in range(0, i+1):
11+
print(alpha[counter], end=" ")
12+
counter =counter + 1
13+
flag = flag -1
14+
print("\r")
15+
16+
17+
print("Enter the number of rows: ")
18+
n = int(input())
19+
pypart2(n)
20+
21+
22+
23+
# OUTPUT
24+
25+
# Enter the number of rows:
26+
# 5
27+
# E
28+
# D E
29+
# C D E
30+
# B C D E
31+
# A B C D E

0 commit comments

Comments
 (0)