Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5f2dc31

Browse files
committed
Print Pattern of letter E
1 parent 4f148b2 commit 5f2dc31

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

‎patterns/Pattern-E.py‎

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

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /