Skip to content

Instantly share code, notes, and snippets.

@akisute
Created January 1, 2010 01:29
Show Gist options
  • Save akisute/267004 to your computer and use it in GitHub Desktop.
Save akisute/267004 to your computer and use it in GitHub Desktop.
#coding: utf-8
space = u' '
message = u"""あけまして
おめでとう
ございます
今年もよろしくお願いします
"""
messageArray = message.split('\n')
maxTokenLength = len(max(messageArray, key=lambda x:len(x)))
for y in range(maxTokenLength):
chars = []
for x in range(len(messageArray)):
messageToken = messageArray[x]
c = space if len(messageToken) <= y else messageToken[y]
chars.append(c)
print ''.join(reversed(chars))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment