next( next( run the iteration protocol next(the map built-in can do similar workby generating the results of running items through functionone at time and on request like rangewrapping it in list forces it to return all its values in python xthis isn' needed in where map makes list of results all at once insteadand is not needed in other contexts that iterate automaticallyunless multiple scans or list-like behavior is also requiredlist(map(summ)[ map sum over items in in python and xcomprehension syntax can also be used to create sets and dictionaries{sum(rowfor row in { create set of row sums { sum( [ ]for in range( ){ creates key/value table of row sums in factlistssetsdictionariesand generators can all be built with comprehensions in and [ord(xfor in 'spaam'list of character ordinals [ {ord(xfor in 'spaam'sets remove duplicates { {xord(xfor in 'spaam'dictionary keys are unique {' ' ' ' ' ' ' ' (ord(xfor in 'spaam'generator of values at dab to understand objects like generatorssetsand dictionariesthoughwe must move ahead dictionaries python dictionaries are something completely different (monty python reference intended)--they are not sequences at allbut are instead known as mappings mappings are also collections of other objectsbut they store objects by key instead of by relative position in factmappings don' maintain any reliable left-to-right orderthey simply map keys to associated values dictionariesthe only mapping type in python' core objects setare also mutablelike liststhey may be changed in place and can grow and shrink on demand also like liststhey are flexible tool for representing collectionsbut their more mnemonic keys are better suited when collection' items are named or labeled--fields of database recordfor example dictionaries