Skip to content

Instantly share code, notes, and snippets.

@eyaltrabelsi
Created July 6, 2019 06:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eyaltrabelsi/22eacc0ca3004616e4514850d8f4566a to your computer and use it in GitHub Desktop.
Save eyaltrabelsi/22eacc0ca3004616e4514850d8f4566a to your computer and use it in GitHub Desktop.
Python trick Finding the index of an item given in an iterable
>>> a = ["foo", "bar", "baz"]
>>> a.index("bar")
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment