Skip to content

Commit

Permalink
Merge pull request #11 from phihag/patch-11
Browse files Browse the repository at this point in the history
sets: more PEP8
  • Loading branch information
yasoob committed Aug 17, 2015
2 parents 85fa33e + 00b73b1 commit aa96166
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions set_-_data_structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ this:

.. code:: python
some_list = ['a','b','c','b','d','m','n','n']
some_list = ['a', 'b', 'c', 'b', 'd', 'm', 'n', 'n']
duplicates = []
for value in some_list:
Expand All @@ -26,7 +26,7 @@ can simply do something like this:

.. code:: python
some_list = ['a','b','c','b','d','m','n','n']
some_list = ['a', 'b', 'c', 'b', 'd', 'm', 'n', 'n']
duplicates = set([x for x in some_list if some_list.count(x) > 1])
print(duplicates)
# Output: set(['b', 'n'])
Expand Down

0 comments on commit aa96166

Please sign in to comment.