Forked from matthieualouis/get_all_positions.py
Last active
February 10, 2016 20:54
-
-
Save nomeyer/8b0c7b68e37a6110113a 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