File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ __author__ = 'Avinash'
2
+
3
+ # Python3 program to print alphabet A pattern
4
+
5
+ # Function to display alphabet pattern
6
+ def print_pattern (n ):
7
+
8
+ # Outer for loop for number of lines(rows)
9
+ for i in range (n ):
10
+
11
+ # Inner for loop for printing *'s and  's(columns)
12
+ for j in range ((n // 2 ) + 1 ):
13
+
14
+ # prints two column lines
15
+ if ((j == 0 or j == n // 2 ) and i != 0 or
16
+
17
+ # print first line of alphabet
18
+ i == 0 and j != 0 and j != n // 2 or
19
+
20
+ # prints middle line
21
+ i == n // 2 ):
22
+ print ("*" , end = "" )
23
+ else :
24
+ print (" " , end = "" )
25
+
26
+ print ()
27
+
28
+
29
+ # Size of the letter
30
+ num = int (input ("Enter the size: \t " ))
31
+
32
+ if num > 7 :
33
+ print_pattern (num )
34
+ else :
35
+ print ("Enter a size minumin of 8" )
You can’t perform that action at this time.
0 commit comments