Python3 Programming Snippet - 2 : Squared Text
I'm sure some fellow Steemit users have seen users on text focused sites like Reddit having comments that are in the format:
GOODBOYE
O Y
O O
D B
B D
O O
Y O
EYOBDOOG
Here's an implementation where you can enter whatever alphanumeric word you'd like to be displayed in above shown example format.
def squareText():
text = input("Enter string\nNote:It will be converted to uppercase\n").upper()
for i in range(len(text)):
for j in range(len(text)):
if i == 0: #1st row, print normally
print(text[j], end='')
elif i == len(text) - 1: #last row, print reverse
print(text[len(text)-1-j], end='')
else: #middle rows
if j == 0:
print(text[i], end='')
elif j == len(text) - 1:
print(text[len(text)-1-i], end='')
else:
print(" ", end='')
print()
Congratulations @notanon! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
You published your First Post
You made your First Vote
You got a First Vote
Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here
If you no longer want to receive notifications, reply to this comment with the word
STOP
Congratulations @notanon! You have received a personal award!
1 Year on Steemit
Click on the badge to view your Board of Honor.
Do not miss the last post from @steemitboard:
Congratulations @notanon! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Vote for @Steemitboard as a witness to get one more award and increased upvotes!