Python Functions
Lambda
1 | lambda x: x**3 fn = |
Declare Function
1 | def fn_name(): ## Where fn_name represents the function name |
Get Function Name
1 | ## First Declare a function |
Document a Function
1 | ## Document a function with three single quotes |
Arguments
1 | def multiply(a, b=0): ## b is 0 by default |
Generator
1 | def count(start, step): |
Decorator
1 | from functools import wraps |