Skip to content

Instantly share code, notes, and snippets.

@repen
Created July 24, 2019 07:40
Show Gist options
  • Save repen/ae32890db50d620bc7b7b5ede31ebb60 to your computer and use it in GitHub Desktop.
Save repen/ae32890db50d620bc7b7b5ede31ebb60 to your computer and use it in GitHub Desktop.
center alignment exam
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