Skip to content

Commit 742bb06

Browse files
committed
Code format and typo fixes
1 parent 2c086b3 commit 742bb06

File tree

1 file changed

+31
-30
lines changed

1 file changed

+31
-30
lines changed

patterns/Pattern-A.py

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
11
__author__ = 'Avinash'
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
2+
3+
4+
# Python3 program to print alphabet A pattern
5+
6+
# Function to display alphabet pattern
7+
def print_pattern(n):
8+
# Outer for loop for number of lines(rows)
9+
for i in range(n):
10+
11+
# Inner for loop for printing *'s and '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+
# Size of the letter
29+
30+
3031
num = int(input("Enter the size: \t "))
31-
32+
3233
if num > 7:
3334
print_pattern(num)
3435
else:
35-
print("Enter a size minumin of 8")
36+
print("Enter a size minimum of 8")

0 commit comments

Comments
 (0)