| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -418,7 +418,7 @@ with no duplicate elements. Basic uses include membership testing and | |||
| 418 | 418 | eliminating duplicate entries. Set objects also support mathematical operations | |
| 419 | 419 | like union, intersection, difference, and symmetric difference. | |
| 420 | 420 | ||
| 421 | - Curly braces or the :func:`set` function can be used to create sets. Note: To | ||
| 421 | + Curly braces or the :func:`set` function can be used to create sets. Note: to | ||
| 422 | 422 | create an empty set you have to use ``set()``, not ``{}``; the latter creates an | |
| 423 | 423 | empty dictionary, a data structure that we discuss in the next section. | |
| 424 | 424 | ||
@@ -447,14 +447,14 @@ Here is a brief demonstration:: | |||
| 447 | 447 | >>> a ^ b # letters in a or b but not both | |
| 448 | 448 | {'r', 'd', 'b', 'm', 'z', 'l'} | |
| 449 | 449 | ||
| 450 | - Like :ref:`for lists <tut-listcomps>`, there is a set comprehension syntax:: | ||
| 450 | + Similarly to :ref:`list comprehensions <tut-listcomps>`, set comprehensions | ||
| 451 | + are also supported:: | ||
| 451 | 452 | ||
| 452 | 453 | >>> a = {x for x in 'abracadabra' if x not in 'abc'} | |
| 453 | 454 | >>> a | |
| 454 | 455 | {'r', 'd'} | |
| 455 | 456 | ||
| 456 | 457 | ||
| 457 | - | ||
| 458 | 458 | .. _tut-dictionaries: | |
| 459 | 459 | ||
| 460 | 460 | Dictionaries | |
| Back | FazBrowse Home | New Git URL |
0 commit comments