Mega Code Archive

 
Categories / Python Tutorial / String
 

Using None as an index has the same effect as a missing index

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