8000 Pattern of Letter V · mafnan1/programminginpython.com@4914ed8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4914ed8

Browse files
committed
Pattern of Letter V
1 parent 4c631f0 commit 4914ed8

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

patterns/Pattern-V.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)
0