built-in functions and exceptions dict([ ]or dict(key value key value type representing dictionary if no argument is givenan empty dictionary is returned if is mapping object (such as dictionary) new dictionary having the same keys and same values as is returned for exampleif is dictionarydict(msimply makes shallow copy of it if is not mappingit must support iteration in which sequence of (key,valuepairs is produced these pairs are used to populate the dictionary dict(can also be called with keyword arguments for exampledict(foo= bar= creates the dictionary 'foo 'bar dir([object]returns sorted list of attribute names if object is moduleit contains the list of symbols defined in that module if object is type or class objectit returns list of attribute names the names are typically obtained from the object' _dict_ attribute if definedbut other sources may be used if no argument is giventhe names in the current local symbol table are returned it should be noted that this function is primarily used for informational purposes (for exampleused interactively at the command lineit should not be used for formal program analysis because the information obtained may be incomplete alsouser-defined classes can define special method _dir_ (that alters the result of this function divmod(abreturns the quotient and remainder of long division as tuple for integersthe value ( /ba bis returned for floats(math floor( ) bis returned this function may not be called with complex numbers enumerate(iter[initial valuegiven an iterable objectiterreturns new iterator (of type enumeratethat produces tuples containing count and the value produced from iter for exampleif iter produces abcthen enumerate(iterproduces ( , )( , )( ,ceval(expr [globals [locals]]evaluates an expression expr is string or code object created by compile(globals and locals are mapping objects that define the global and local namespacesrespectivelyfor the operation if omittedthe expression is evaluated in the namespace of the caller it is most common for globals and locals to be specified as dictionariesbut advanced applications can supply custom mapping objects exec(code [global [locals]]executes python statements code is stringa fileor code object created by compile(globals and locals define the global and local namespacesrespectivelyfor the operation if omittedthe code is executed in the namespace of the caller if no global or local dictionaries are giventhe behavior of this function is little muddled between python versions in python exec is actually implemented as special language statementwhereas python implements it as standard library function subtle side effect of this implementation difference is that in python code evaluated by exec can freely mutate local variables in the caller' namespace in python you can execute code that makes such changesbut they don' seem to have any lasting effect beyond the exec(call itself this is because python uses locals(to obtain the local namespace if one isn' supplied as you will note in the documentation for locals()the returned dictionary is only safe to inspectnot modify lib fl ff