Skip to content

Instantly share code, notes, and snippets.

@MSeifert04
Last active March 4, 2017 22:46
Show Gist options
  • Save MSeifert04/54ec072097441d5a8ebc33967f632a97 to your computer and use it in GitHub Desktop.
Save MSeifert04/54ec072097441d5a8ebc33967f632a97 to your computer and use it in GitHub Desktop.
# explicit loops
l = []
for a in x:
for b in a:
if b == k:
l.append(b)
# list-comprehension
[b
for a in x
for b in a
if b == k]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment