# Each time through we would like to chop off the last character. s = 'abcde' i = -1 for i in range(-1, -len(s), -1): print s[:i]