Built-in

id

The id function returns the "identity" of an object, that is, a constant numeric value that uniquely identifies the object for as long as it is defined.

In Python, anything is an object, so we can get the identity from -even- the id function.

The identity of an object can vary from one execution of the code to another. Some objects always receive the same identity (integers between -5 and 256 inclusive, for example).

Submitted by admin on Wed, 01/13/2021 - 14:56

filter

The filter function takes a function and an iterable object as arguments and returns the elements of the iterable that satisfy the function (those for which the function returns the boolean True). We can say that filter filters the iterable leaving only those elements that satisfy the indicated function.

Submitted by admin on Wed, 01/13/2021 - 14:11

dir

The dir function returns the set of names associated with the object included as an argument. If no argument is included, returns the set of names in the local scope.

Submitted by admin on Mon, 01/11/2021 - 14:37

sum

The sum function sums the start value and the values contained in the iterator included as the first argument, returning the total. By default, start takes the value 0.

Submitted by admin on Wed, 01/30/2019 - 15:31

hash

The hash function returns the hash value of the object passed as a argument -if any-. Hash values are integers. Numeric values that, when compared, return True have the same associated hash value, even if they are of different type.

Submitted by admin on Fri, 01/25/2019 - 16:45

input

The input function returns the value of prompt -if it has been included as an argument to the function-, reads a line from the standard input -the keyboard, by default-, converts it to a text string and returns it as result of the function.

Submitted by admin on Wed, 01/23/2019 - 14:50

enumerate

The enumerate function accepts as an input argument a sequence, an iterator or another object that supports iteration and returns an iterator of type "enumerate" composed of tuples formed by a counter (starting with the value start) and each of the values of the input iterator.

Submitted by admin on Mon, 01/21/2019 - 21:39

sorted

The sorted function returns a new ordered list from the elements of the iterable passed as an argument.

Submitted by admin on Sun, 01/20/2019 - 18:19

min

The min function returns the minimum value of an iterable, or the minimum value of two or more arguments. If only one positional argument is specified, it must be an iterable and the function will return its lowest element. If two or more positional arguments are included, the function will return the lowest argument. If multiple minimum values are found, the first one found is returned.

Submitted by admin on Sun, 01/20/2019 - 18:09