Skip to content

Instantly share code, notes, and snippets.

@wonderb0lt
Created October 17, 2014 12:11
Show Gist options
  • Save wonderb0lt/fffa891586d401208414 to your computer and use it in GitHub Desktop.
Save wonderb0lt/fffa891586d401208414 to your computer and use it in GitHub Desktop.
That's why, @Mezgrman.
>>> l = [1, 2, 3, 4]
>>> [i for i in l if i % 2 == 0]
[2, 4]
>>> [for i in l if i % 2 == 0]
File "<input>", line 1
[for i in l if i % 2 == 0]
^
SyntaxError: invalid syntax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment