Functional Python and Modules
Functional Python — cheat sheet
Write concise, expressive data transformations using functional tools.
Lambdas & Higher-Order Functions
square = lambda x: x ** 2Inline anonymous function.
list(map(lambda x: x*2, nums))Transform every element lazily.
list(filter(lambda x: x>0, nums))Keep elements matching predicate.
Decorators
def func(): passWrap function execution with decorator.
(func)Preserve original function __name__ and __doc__.