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 4c631f0 commit 4914ed8Copy full SHA for 4914ed8
patterns/Pattern-V.py
@@ -0,0 +1,41 @@
1
+__author__ = 'Avinash'
2
+
3
4
+# Python3 program to print alphabet pattern V
5
6
+# * *
7
8
9
10
11
12
13
14
15
+# *
16
17
+def print_pattern(n):
18
+ # row looping
19
+ for row in range(n):
20
21
+ # column looping
22
+ for column in range(n):
23
+ if (
24
+ # right slanting line
25
+ (row + column == n - 1 and row < n / 2) or
26
27
+ # left slanting line
28
+ (row == column and row < n / 2)
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 * 2) + 1)
0 commit comments