Created
July 24, 2019 07:40
-
-
Save repen/ae32890db50d620bc7b7b5ede31ebb60 to your computer and use it in GitHub Desktop.
center alignment exam
This file contains hidden or 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
length = 7 | |
text = "Ну привет" | |
for x in range(1, length + 1 ): | |
if x == 1 or x == length: | |
for i in range(length): | |
print(" ━", end="") | |
print() | |
else: | |
if (length - 1) / 2 + 1 == x: | |
print("┃", "{:^{}}".format(text, (length*2 -3)), "┃") | |
pass | |
else: | |
print("┃", " " * (length*2 -3), "┃") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment