pylib/Built-in Functions
dir() |
|
id(object) | Return the “identity” of an object. This is an integer which is
guaranteed to be unique and constant for this object during its
lifetime. Two objects with non-overlapping lifetimes may have the same
id() value.
CPython implementation detail: This is the address of the object in memory. |
iter() | called on an iterable, returns an iterator object for that iterable |
len() | |
list() | Rather than being a function, list is actually a mutable sequence type >>> |
map(f,iter) | map(function, iterable, ...) Return an iterator
that applies function to every item of iterable, yielding the results.
list(map(len, ['a', 'aaa', 'aa'])) >>> [1, 3, 2] |
open() | The standard way to open files for reading and writing with Python. |
sorted() | sorted(iterable, *, key=None, reverse=False) see Sorting HOW TO. A common pattern is to sort complex objects using some of the object’s indices as keys. tup = (s, fnp) |
str() | return a string version of object lib/stdtypes#str. | String Type. |
sum() | sum(iterable, start=0)
Better ''.join(sequence) concatenate a sequence of strings math.fsum() to add floating point values with extended precision. itertools.chain() to concatenate a series of iterables. es: sum( f(x) for x in X ) esempio con list comprehension |
zip(iter) zip(*iter) |
zip(*iter) cioe' unzip |