File tree 1 file changed +31
-30
lines changed 1 file changed +31
-30
lines changed Original file line number Diff line number Diff line change 1
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
2
+
3
+
4
+ # Python3 program to print alphabet A pattern
5
+
6
+ # Function to display alphabet pattern
7
+ def print_pattern (n ):
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
+ # Size of the letter
29
+
30
+
30
31
num = int (input ("Enter the size: \t " ))
31
-
32
+
32
33
if num > 7 :
33
34
print_pattern (num )
34
35
else :
35
- print ("Enter a size minumin of 8" )
36
+ print ("Enter a size minimum of 8" )
You can’t perform that action at this time.
0 commit comments