Created
March 30, 2023 13:38
-
-
Save modos/ceaf935668ce04f2faa19740fe93e9be 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
n = int(input()) | |
for i in range(n): | |
for j in range(n): | |
if i == 0 or i == n - 1 or j == 0 or j == n - 1: | |
print("#", end="") | |
elif i == j: | |
print("#", end="") | |
elif i+j == n-1: | |
print("#", end="") | |
elif j > n-1-i and i<= n//2: | |
print("#", end="") | |
elif j>i and i > n//2: | |
print("#", end="") | |
else: | |
print(" ", end="") | |
print("") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment