Last active
September 24, 2020 10:54
-
-
Save Tuhin-thinks/1c1030b012382d27cddc7fed638257b2 to your computer and use it in GitHub Desktop.
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
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