This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.
I want to save this thing I came across for future reference… a nice way to enumerate over an iterable in python in reverse order while retaining the proper indexes. 
 Here’s the issue. This code: 
 #!/usr/bin/python 
 
 WORDS = [ 'zero' , 'one' , 'two' ] 
 
 for index , string in enumerate ( reversed ( WORDS )): 
 print index , string 
 … prints…
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.