循环切片操作

s = 'abcde'
for i in [None] + range(-1,-len(s),-1):
    print s[:i]
#abcde
#abcd
#abc
#ab
#a

 

  

posted @ 2016-06-21 09:48  你好呀。  阅读(149)  评论(0编辑  收藏  举报