Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created July 8, 2013 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shigemk2/5949552 to your computer and use it in GitHub Desktop.
Save shigemk2/5949552 to your computer and use it in GitHub Desktop.
def _treatment(pos, element):
return '%d: %s' % (pos, element)
seq = ["one", "two", "three"]
print [_treatment(i, el) for i, el in enumerate(seq)] #['0: one', '1: two', '2: three']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment