product for in [ ]product * print(productprints product iter([ ]while truetryproduct *next(iexcept stopiterationbreak print(productprints any (finiteiterableican be converted into tuple by calling tuple( )or can be converted into list by calling list(ithe all(and any(functions can be used on iterators and are often used in functional-style programming here are couple of usage examples that show all()any()len()min()max()and sum() [- - all( )any( )len( )min( )max( )sum( (truetrue - append( all( )any( )len( )min( )max( )sum( (falsetrue - of these little functionslen(is probably the most frequently used the enumerate(function takes an iterator and returns an enumerator object this object can be treated like an iteratorand at each iteration it returns -tuple with the tuple' first item the iteration number (by default starting from )and the second item the next item from the iterator enumerate(was called on let' look at enumerate()' use in the context of tiny but complete program the grepword py program takes word and one or more filenames on the command line and outputs the filenameline numberand line whenever the line contains the given word here' sample rungrepword py dom data/forenames txt data/forenames txt: :dominykas data/forenames txt: :dominik data/forenames txt: :domhnall data/forenames txt: :dominic data files data/forenames txt and data/surnames txt contain unsorted lists of namesone per line in will see two other implementations of this programgrepword- py and grepwordt pywhich spread the work over multiple processes and multiple threads functionalstyle programming