Functions and Modules
The function as carrying out a set of operations and returning an object is basic to Python. Functions, lambda as the elegant anonymous one-line function, nested functions, and recursive functions are all discussed with illustrations. Local, non-local, and global sift out the scope of entities in nested schemes. A module has functions and stand alone statements within it. A module can be imported into any environment and its functions used contextually. Math is a key built-in module in Python with the exponential, trigonometric, and related functions as its main contents. Use of these from the math module, to suit contexts, is illustrated through examples.
KeywordsCode Block Function Call Parity Check Function Definition Cube Root
- Padmanabhan TR (2007) Introduction to microcontrollers and their applications. Alpha science international ltd, OxfordGoogle Scholar
- Rossum Gv, Drake FL Jr (2014) The Python library reference. Python software foundationGoogle Scholar
- Sullivan M (2008) Algebra & trigonometry, 8th edn. Pearson Prentice hall, New JerseyGoogle Scholar
- Zwillinger D (ed) (2003) Standard mathematical tables and formulae. Chapman & Hall/CRC, New YorkGoogle Scholar