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