8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19ca856 commit 543c63cCopy full SHA for 543c63c
patterns/Pattern-Y.py
@@ -0,0 +1,40 @@
1
+__author__ = 'Avinash'
2
+
3
4
+# Python3 program to print alphabet pattern Y
5
6
+# * *
7
8
9
10
11
12
+# *
13
14
15
16
17
18
19
+def print_pattern(n):
20
+ for row in range(n):
21
+ for column in range(n):
22
+ if(
23
+ # right slanting line
24
+ (row + column == n-1) or
25
26
+ # left slanting line half
27
+ (row == column and row < n/2)
28
+ ):
29
+ print("* ", end=" ")
30
+ else:
31
+ print(" ", end=" ")
32
+ print()
33
34
35
+size = int(input("Enter any size: \t"))
36
37
+if size < 8:
38
+ print("Enter a number minimum of 8")
39
+else:
40
+ print_pattern(size)
0 commit comments