Skip to content

Instantly share code, notes, and snippets.

@Tuhin-thinks
Last active September 24, 2020 10:54
Show Gist options
  • Save Tuhin-thinks/1c1030b012382d27cddc7fed638257b2 to your computer and use it in GitHub Desktop.
Save Tuhin-thinks/1c1030b012382d27cddc7fed638257b2 to your computer and use it in GitHub Desktop.
height = 10
width = 10
for i in range(height): # row
for j in range(width): # columns
if i in [height-1, 0]:
if j != 0 and j != width-1:
print('X', end='')
else:
print(' ',end='')
elif i in [height-2, 1]:
if j in [0,width-1]:
print('X', end='')
else:
print(' ', end='')
else:
if j ==0:
print('X',end='')
else:
print(' ', end='')
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment