Built-in

float

The float function returns a real number from a number or a text string.

If the argument is a text string, it should contain the decimal point (though not required, see example below), optionally preceded by a sign. If no argument is added, the function returns the real number 0.0. The argument can also be a text string representing a "nan" (not a number) or a positive or negative infinity. More exactly, the argument must comply with the following grammar after removing whitespaces at the beginning and end of the string:

Submitted by admin on Sun, 01/20/2019 - 13:25

dict

The dict function creates a new dictionary. If no arguments are included, an empty dictionary will be created. If an argument is included and this is an object of type "mapping", an empty dictionary will be created with the same key-value pairs as the mapping object. In any other case, the argument must be an iterable object, and each element of the object must, in turn, be an iterable object with exactly two objects. The first object will become a key in the new dictionary, and the second object will become the corresponding value.

Submitted by admin on Sun, 01/20/2019 - 11:39

complex

The complex function returns an imaginary number from the values given as arguments for the real and imaginary part of it, or from a text string containing the representation of a complex number.

Either argument can be of any numeric type, including complex numbers (see example below). If the second argument is omitted, a value of 0 is assumed. If the two arguments are omitted, both values are assumed to be. The first argument cannot be omitted if the second argument is to be added.

Submitted by admin on Sun, 01/20/2019 - 11:10

chr

The chr function returns the character whose Unicode code n is passed as an argument. The valid range for n is 0 to 1,114,111 (0x10FFFF in base 16). If the argument is outside this range, the function returns an error of type ValueError .

Unicode character list

This function is the inverse of the ord function.

Submitted by admin on Sun, 01/20/2019 - 10:51

breakpoint

The breakpoint function executes the debugger. Specifically, it calls sys.breakpointhook(), passing the arguments received, args, and kws as arguments.

Submitted by admin on Sun, 01/20/2019 - 00:43

bool

The bool function converts an x value to its boolean equivalent according to the Truth Value Testing. If x is False or is omitted, the function returns False. In any other case, it returns True.

Submitted by admin on Sun, 01/20/2019 - 00:30

bin

The bin function converts an integer to its binary representation in text format. The result will be preceded by the characters "0b". If the number is negative, the result will be preceded by the characters "-0b".

Submitted by admin on Sun, 01/20/2019 - 00:13

ascii

The ascii function returns a string containing a printable representation of an object.

Submitted by admin on Sun, 01/20/2019 - 00:02

any

The any function returns the boolean True if any of the elements of the iterable that is passed as an argument is True, and returns the boolean False otherwise (or if the iterable is empty).

This function is equivalent to:

def any(iterable):

    for element in iterable:

        if element:

            return True

    return False

Submitted by admin on Sat, 01/19/2019 - 23:44

all

The all function returns the boolean True if all elements in the iterable passed as an argument are True (or if the iterable is empty), and returns the boolean False otherwise.

This function is equivalent to:

def all(iterable):

    for element in iterable:

        if not element:

            return False

    return True

Submitted by admin on Sat, 01/19/2019 - 23:05