data structuresalgorithmsand code simplification imap(functioniter iter iterncreates an iterator that produces items function( , in)where in are items taken from the iterators iter iter iternrespectively if function is nonethe tuples of the form ( inare returned iteration stops whenever one of the supplied iterators no longer produces any values islice(iterable[start,stop [step]creates an iterator that produces items in manner similar to what would be returned by sliceiterable[start:stop:stepthe first start items are skipped and iteration stops at the position specified in stop step specifies stride that' used to skip items unlike slicesnegative values may not be used for any of startstopor step if start is omittediteration starts at if step is omitteda step of is used izip(iter iter iterncreates an iterator that produces tuples ( in)where in are taken from the iterators iter iter iternrespectively iteration stops whenever one of the supplied iterators no longer produces any values this function produces the same values as the built-in zip(function izip_longest(iter iter itern [,fillvalue=none]the same as izip(except that iteration continues until all of the input iterables iter iter and so on are exhausted none is used to fill in values for the iterables that are already consumed unless different value is specified with the fillvalue keyword argument permutations(iterable [ ]creates an iterator that returns all -length permutations of items from iterable if is omittedthen permutations have the same length as the number of items in iterable product(iter iter itern[repeat= ]creates an iterator that produces tuples representing the cartesian product of items in item item and so on repeat is keyword argument that specifies the number of times to repeat the produced sequence repeat(object [times]creates an iterator that repeatedly produces object timesif suppliedspecifies repeat count otherwisethe object is returned indefinitely starmap(func [iterable]creates an iterator that produces the values func(*item)where item is taken from iterable this only works if iterable produces items suitable for calling function in this manner takewhile(predicate [iterable]creates an iterator that produces items from iterable as long as predicate(itemis true iteration stops immediately once predicate evaluates as false lib fl ff