Skip to content

Commit 84fa832

Browse files
Small edits to Comprehensions.
Tiny text fix and also fixed the last example as the result should have been squared (for clarity).
1 parent 60fd597 commit 84fa832

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

comprehensions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ comprehensions are supported in both Python 2 and Python 3:
1111
- set comprehensions
1212

1313
We will discuss them one by one. Once you get the hang of using ``list``
14-
comprehensions then you can use anyone of them easily.
14+
comprehensions then you can use any of them easily.
1515

1616
``list`` comprehensions
1717
^^^^^^^^^^^^^^^^^^^^^^^
@@ -88,6 +88,6 @@ that they use braces ``{}``. Here is an example:
8888

8989
.. code:: python
9090
91-
squared = {x for x in [1, 1, 2]}
91+
squared = {x**2 for x in [1, 1, 2]}
9292
print(squared)
93-
# Output: {1, 2}
93+
# Output: {1, 4}

0 commit comments

Comments
 (0)