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 543c63c commit 8f851c6Copy full SHA for 8f851c6
patterns/Pattern-Z.py
@@ -0,0 +1,41 @@
1
+__author__ = 'Avinash'
2
+
3
+# Python3 program to print alphabet pattern Z
4
5
+'''
6
+ * * * * * * * *
7
+ *
8
9
10
11
12
13
14
15
16
17
+def print_pattern(n):
18
+ for row in range(n):
19
+ for column in range(n):
20
+ if(
21
+ # first row
22
+ (row == 0) or
23
24
+ # last row
25
+ (row == n-1) or
26
27
+ # slanting line
28
+ (row+column == n-1)
29
+ ):
30
+ print("*", end=" ")
31
+ else:
32
+ print(" ", end=" ")
33
+ print()
34
35
36
+size = int(input("Enter any size: \t"))
37
38
+if size < 8:
39
+ print("Enter a size minimum of 8")
40
+else:
41
+ print_pattern(size)
0 commit comments