8000 Pattern of Letter T · raun1997/programminginpython.com@9a2a6a0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9a2a6a0

Browse files
committed
Pattern of Letter T
1 parent 04d728d commit 9a2a6a0

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

patterns/Pattern-T.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
__author__ = 'Avinash'
2+
3+
4+
# Python3 program to print alphabet pattern T
5+
6+
'''
7+
* * * * * * * * *
8+
*
9+
*
10+
*
11+
*
12+
*
13+
*
14+
*
15+
*
16+
'''
17+
18+
19+
def print_pattern(n):
20+
for row in range(n):
21+
for column in range(n):
22+
if (
23+
# first row
24+
(row == 0) or
25+
26+
# middle column
27+
(column == n//2)
28+
):
29+
print("*", end=" ")
30+
else:
31+
print(" ", end=" ")
32+
print()
33+
34+
35+
size = int(input("Enter a size: \t"))
36+
37+
if size < 8:
38+
print("Enter a size minimum of 8")
39+
else:
40+
print_pattern(size)

0 commit comments

Comments
 (0)
0