Skip to content Skip to sidebar Skip to footer

Need Consumer And Producer With Duplicate Filter Python

I have a script which send requests to social media site by doing following: It first scrapes the friends of the account inserted. It then continues to scrape all friends of the ac

Solution 1:

Python also includes a data type for sets. A set is an unordered collection with no duplicate elements. Note: to create an empty set you have to use

set()

There is an ordered set recipe for this which is referred to from the Python 2 Documentation http://code.activestate.com/recipes/576694/

This runs on Py2.6 or later and 3.0 or later without any modifications. The interface is almost exactly the same as a normal set, except that initialisation should be done with a list.

OrderedSet([1, 2, 3])

Post a Comment for "Need Consumer And Producer With Duplicate Filter Python"