File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ __author__ = 'Avinash'
2
+
3
+
4
+ # Python3 program to print alphabet pattern W
5
+
6
+ # * *
7
+ # * *
8
+ # * *
9
+ # * *
10
+ # * *
11
+ # * *
12
+ # * *
13
+ # * * *
14
+ # * * * *
15
+ # * * * *
16
+ # * * * *
17
+ # * * * *
18
+ # * * * *
19
+ # * * * *
20
+ # * *
21
+
22
+ def print_pattern (n ):
23
+ for row in range (n ):
24
+ for column in range (n ):
25
+ if (
26
+ # first column
27
+ (column == 0 ) or
28
+
29
+ # last column
30
+ (column == n - 1 ) or
31
+
32
+ # left slanting line
33
+ (row + column == n - 1 and row >= n // 2 ) or
34
+
35
+ # right slanting line
36
+ (row == column and row >= n // 2 )
37
+ ):
38
+ print ("*" , end = " " )
39
+ else :
40
+ print (" " , end = " " )
41
+ print ()
42
+
43
+
44
+ size = int (input ("Enter any size: \t " ))
45
+
46
+ if size < 8 :
47
+ print ("Enter a number minimum of 8" )
48
+ else :
49
+ print_pattern (size )
You can’t perform that action at this time.
0 commit comments