Skip to content

Instantly share code, notes, and snippets.

@shamikalashawn
Created February 6, 2017 22:43
Show Gist options
  • Save shamikalashawn/3539b51dc33d16f67554f1dcb149eb02 to your computer and use it in GitHub Desktop.
Save shamikalashawn/3539b51dc33d16f67554f1dcb149eb02 to your computer and use it in GitHub Desktop.
A character is turned into a box with the inside missing.
def create_open_box(height, width, character):
box = ''
if height in range(1,3) or width in range(1,3):
for row in range(height):
box = box + (character * width) + '\n'
print('regular open box')
else:
for row in range(height):
if row == 0 or row == height-1:
box = box + (character * width) + '\n'
else:
box = box + character + (" " * (width - 2)) + character + '\n'
print (box)
return box
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment