文字列を逆順にする

>>> str = "abcdefg"
>>> str[::-1]
'gfedcba'
>>>
>>> str[0:5:2]    # 0番目から5番目までを2つおきに取り出す
'ace'
>>> str[-1:-5:-1] # 後ろの4つの要素を逆順に取り出す
'gfed'