Last active
February 12, 2016 13:36
-
-
Save matthieualouis/c4e6bc9c7977e2bd6870 to your computer and use it in GitHub Desktop.
Get all positions of a value in a list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
L = [1, 2, 3, 1] | |
[i for i,x in enumerate(L) if x == value] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment