Skip to content

Instantly share code, notes, and snippets.

@thekindlyone
Created July 8, 2014 17:00
Show Gist options
  • Save thekindlyone/ca48ca2a14388516034c to your computer and use it in GitHub Desktop.
Save thekindlyone/ca48ca2a14388516034c to your computer and use it in GitHub Desktop.
multislice=lambda mainstring,indices: ''.join([i[1] for i in enumerate(mainstring) if i[0] in indices])
print multislice('This page contains examples and source code',[0,2,5,11,12,14,15,23,24,25,26])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment