分片

>>> s='hello,world'

>>> s[::-1]     #分片将会从右到左进行

'dlrow,olleh'

>>> s[5:1:-1]

',oll'

>>> s[5:1]

''

>>>

原文地址:https://www.cnblogs.com/wawawawa-briefnote/p/8678821.html