Skip to content

Instantly share code, notes, and snippets.

@smoitra87
Created November 12, 2012 21:53
Show Gist options
  • Save smoitra87/4062183 to your computer and use it in GitHub Desktop.
Save smoitra87/4062183 to your computer and use it in GitHub Desktop.
Index of min - One Liner
import random
arr = range(10)
random.shuffle(arr)
reduce(lambda x,y: (x[1]<y[1])and x or y ,enumerate(x))[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment