Functions Flashcards
Chapter 4
Returns the absolute value of a number
X=abs(number)
Returns True if all items in an iterable object are true
x=all(iterable)
Returns True if any item in an iterable object is true
x=any(iterable)
Returns a readable version of an object. Replaces none-ascii characters with escape character
x=ascii(object)
Returns the binary version of a number
X=bin(integer)
Returns the boolean value of the specified object
X=bool(object)
Returns True if the specified object is callable, otherwise False
X=callable(object)
Returns the specified source as an object, ready to be executed
X=compile(source, filename, mode, flag, dont_inherit, optimize)
Returns a complex number
X=complex(real,imaginary)
Deletes the specified attribute (property or method) from the specified object
delattr(object, attribute)
Returns a dictionary (Array)
X=dict(key=value,…)
Returns the quotient and the remainder when argument1 is divided by argument2
X=divmod(dividend, divisor)
Takes a collection (e.g. a tuple) and returns it as an enumerate object
X=enumerate(iterable, start)
Use a filter function to exclude items in an iterable object
X=filter(function, iterable)
Returns a floating point number
X=float(value)
Formats a specified value
X=format(value, format)
Returns the value of the specified attribute (property or method)
X=getattr(object, attribute, default)