Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def frame_and_fortune(string):
- retval = ""
- data = string.split()
- tempdat = sorted(data, key=len, reverse=1)
- mval = len(tempdat[0])
- intemp = mval + 4
- retval += "*" * intemp
- retval += "\n"
- for word in data:
- retval += "* {0}{1} *\n".format(word, " "*(mval - len(word)))
- retval += "*" * intemp
- return retval
- print frame_and_fortune("This is a test look at how testy i am")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement