8000 Print pattern of letter 'A' · brohimah/programminginpython.com@2c086b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2c086b3

Browse files
authored
Print pattern of letter 'A'
1 parent e494efc commit 2c086b3

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

patterns/Pattern-A.py

Lines changed: 35 additions & 0 deletions
< 76E3 /tr>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
__author__ = 'Avinash& 8000 #39;
2+
3+
# Python3 program to print alphabet A pattern
4+
5+
# Function to display alphabet pattern
6+
def print_pattern(n):
7+
8+
# Outer for loop for number of lines(rows)
9+
for i in range(n):
10+
11+
# Inner for loop for printing *'s and &nbsp's(columns)
12+
for j in range((n // 2) + 1):
13+
14+
# prints two column lines
15+
if ((j == 0 or j == n //2) and i != 0 or
16+
17+
# print first line of alphabet
18+
i == 0 and j != 0 and j != n // 2 or
19+
20+
# prints middle line
21+
i == n // 2):
22+
print("*", end = "")
23+
else:
24+
print(" ", end = "")
25+
26+
print()
27+
28+
29+
# Size of the letter
30+
num = int(input("Enter the size: \t "))
31+
32+
if num > 7:
33+
print_pattern(num)
34+
else:
35+
print("Enter a size minumin of 8")

0 commit comments

Comments
 (0)
0