Framed Reflection
Last updated
Last updated
def mirror(text):
words=text.split()
max_w_len = len(max(words))
topbottom = "*"*(max_w_len+4)+'\n'
res = topbottom + \
''.join([ '* ' + w[::-1] + ' '*(max_w_len-len(w)) + ' *\n' for w in words ]) + \
topbottom[:-1]
return res