Skip to content

Instantly share code, notes, and snippets.

@rohitfarmer
Created November 8, 2018 16:29
Show Gist options
  • Select an option

  • Save rohitfarmer/da2aa4f81a77018ec65412aaac384270 to your computer and use it in GitHub Desktop.

Select an option

Save rohitfarmer/da2aa4f81a77018ec65412aaac384270 to your computer and use it in GitHub Desktop.
Example code in Python

To get the index of a value in a list
indx = [i for i, v in enumerate(lis) if v == 1]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment