summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPhoenixYip <phx13ye@gmail.com>2016-09-06 16:38:47 +0800
committerven <vendethiel@hotmail.fr>2016-09-06 10:38:47 +0200
commit48ca03c3f9cfa1dc18ece421e98bf62072d519f0 (patch)
tree7af705759355255da0e716a7c3dd29dbd674dd8b
parent801da0cd8aeab1870e557cc58ee4c0e8ba3a3f73 (diff)
correction for the set comprehension in py3 (#2358)
-rw-r--r--python3.html.markdown2
1 files changed, 1 insertions, 1 deletions
diff --git a/python3.html.markdown b/python3.html.markdown
index dc534f74..5298553f 100644
--- a/python3.html.markdown
+++ b/python3.html.markdown
@@ -602,7 +602,7 @@ list(filter(lambda x: x > 5, [3, 4, 5, 6, 7])) # => [6, 7]
[x for x in [3, 4, 5, 6, 7] if x > 5] # => [6, 7]
# You can construct set and dict comprehensions as well.
-{x for x in 'abcddeef' if x in 'abc'} # => {'d', 'e', 'f'}
+{x for x in 'abcddeef' if x not in 'abc'} # => {'d', 'e', 'f'}
{x: x**2 for x in range(5)} # => {0: 0, 1: 1, 2: 4, 3: 9, 4: 16}