Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
programminginpython.com/patterns/Pattern-E.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
38 lines (28 sloc)
701 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'Avinash' | |
# Python3 program to print alphabet E pattern | |
# ********* | |
# * | |
# * | |
# * | |
# ********* | |
# * | |
# * | |
# ********* | |
def print_pattern(n): | |
# Outer for loop for number of rows | |
for row in range(n): | |
# Inner for loop columns | |
for column in range(n): | |
# prints first and last and middle row | |
if ((row == 0 or row == n - 1 or row == n // 2) or | |
# prints first column | |
column == 0): | |
print("*", end="") | |
else: | |
print(" ", end="") | |
print() | |
size = int(input("Enter size: \t")) | |
if size < 8: | |
print("Enter a size greater than 8") | |
else: | |
print_pattern(size) |