1.遍历list s = 'abcde' for i in [None] + range(-1,-len(s),-1): print s[:i] 转载于:https://www.cnblogs.com/knnotow/p/4658726.html