Last active
September 30, 2021 04:57
-
-
Save dannyhvc/3501df18943b764731cd10815df3d2c0 to your computer and use it in GitHub Desktop.
index of instances
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
def index_of_instances(container, value_to_find): | |
return [i for i, x in enumerate(container) if x == value_to_find] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment