take a string and display it in a loop. : Length : String PYTHON TUTORIALS


PYTHON TUTORIALS » String » Length »

 

take a string and display it in a loop.


# 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]



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo String
» Length