| 
 
 
 
 enumerate, reversed, sorted, zipfilter, iter, mapabs, divmod, pow,  roundbin, chr, hex, oct, ord 
Draft for Information Only ContentPython Built-in Conversion Functions
 filter()Parameters
 Remarks
 
 iter()Parameters
 Remarks
 
 map()Parameters
 Remarks
 Source and Reference
 
Python Built-in Conversion Functions
The Python interpreter has some built-in conversion functions.
     filter()
filter(function, iterable)Parameterstype()to return an iterator fromiterablefor whichfunctionreturns true.functionto specify thefunctionto be used for testingiterableto specify aniterableto be returned fromRemarksfilterconstructs an iterator from those elements ofiterablefor whichfunctionreturns trueiterablemay be either a sequence, a container which supports iteration, or an iterator.If functionisNone, the identity function is assumed, that is, all elements ofiterablethat are false are removed.If functionis notNone,filter(function, iterable)is equivalent to the generator expression(item for item in iterable if function(item)),filter(function, iterable)is equivalent toif functionisNone, (item for item in iterable if item)See itertools.filterfalse() for the complementary function that returns elements of iterable for which function returns false.
 iter()
iter(object[, sentinel])Parametersiter()to return an iterator object.objectto specify anobjectto be returned from[sentinel]to specifysentinelRemarksIf sentinelis omitted,objectmust be a collection object which supports the iteration protocol (the__iter__()method), or it must support the sequence protocol (the__getitem__()method with integer arguments starting at 0). If it does not support either of those protocols,TypeErroris raised.If sentinelis specified, thenobjectmust be a callable object. The iterator created in this case will callobjectwith no arguments for each call to its__next__()netgid; if the value returned is equal tosentinel,StopIterationwill be raised, otherwise the value will be returned.One useful application of the second form of iter()is to build a block-reader.
 map()
map(function, iterable, ...)Parametersmap()to return an iterator that appliesfunctionto every item ofiterable, yielding the results.functionto specify the function to be used for applyingiterableto specify the iterable to be applied toRemarksIf additional iterableare passed,functionmust take that many arguments and is applied to the items from all iterables in parallel.With multiple iterables, the iterator stops when the shortest iterable is exhausted.For cases where the function inputs are already arranged into argument tuples, as in itertools.starmap()
 Source and Reference©sideway
 
 ID: 201002302 Last Updated: 10/23/2020 Revision: 0 |  |