Skip to content

Commit 093ee18

Browse files
authored
Create alphabeticpattern20.py
1 parent 2bbd7bd commit 093ee18

File tree

1 file changed

+25
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)