From e25918acabcafc8f2e3bda35e8e28fa583cb70b9 Mon Sep 17 00:00:00 2001 From: Christopher Lorton Date: Mon, 21 Nov 2016 01:38:39 -0800 Subject: Fix comment in set comprehension example (#2580) The result should be {'a', 'b', 'c'} (not {'d', 'e', 'f'}). --- python.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python.html.markdown') diff --git a/python.html.markdown b/python.html.markdown index 55f56071..050503c3 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -550,7 +550,7 @@ 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 in 'abc'} # => {'a', 'b', 'c'} {x: x**2 for x in range(5)} # => {0: 0, 1: 1, 2: 4, 3: 9, 4: 16} -- cgit v1.2.3