Skip to content

Instantly share code, notes, and snippets.

@Nurdok
Created July 13, 2012 23:25
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 Nurdok/3108196 to your computer and use it in GitHub Desktop.
Save Nurdok/3108196 to your computer and use it in GitHub Desktop.
Double Iteration in List Comprehension
>>> result = []
... for x in seq:
... if len(seq) > 1:
... for y in x:
... if y != 'e':
... result.append(y)
... result
['a', 'b', 'c', 'd', 'f', 'g', 'h', 'i']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment