1.python中实现字符串的对齐:左对齐,居中对齐,右对齐
>>> print ('|','hej'.ljust(20),'|','hej'.rjust(20),'|','hej'.center(20))
| hej | hej | hej |
2.把字符串逐词反转
>>> reverword = ''.join(reversed('hello'))
>>> reverword
'olleh'