-
-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathPattern-V.py
41 lines (32 loc) · 978 Bytes
/
Pattern-V.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
__author__ = 'Avinash'
# Python3 program to print alphabet pattern V
# * *
# * *
# * *
# * *
# * *
# * *
# * *
# * *
# * *
# *
def print_pattern(n):
# row looping
for row in range(n):
# column looping
for column in range(n):
if (
# right slanting line
(row + column == n - 1 and row < n / 2) or
# left slanting line
(row == column and row < n / 2)
):
print("*", end=" ")
else:
print(" ", end=" ")
print()
size = int(input("Enter any size: \t"))
if size < 8:
print("Enter a size minimum of 8")
else:
print_pattern((size * 2) + 1)