Python‎ > ‎itertools‎ > ‎

itertools.chain()

http://www.adilwaseem.com/

Definition
Return a chain object from the first iterable until it is exhausted, then elements from the next iterable, until all of the iterables are exhausted.

Syntax
chain(iterables) --> chain object

Parameters
iterable

Example
The return is:
 import itertools
set={"Python", "Lake", "learning", "Center"}
y=itertools.chain(set)
for value in y: print(value)

>>> 
Python
Center
Lake
learning
>>>

itertools.chain(set.difference)

Comments