This chapter covers the following:
Creating and using functions
Using default value parameters and keyword arguments
Using local and global variables
Creating lambda functions
Applying functions to the sequences
Using function attributes
Using iterators, generators, and generator expressions
Importing and using modules
Using command-line arguments
Let us begin the chapter with functions and their statements.
A function is a group of statements that can be invoked any number of times. Besides the built-in functions, you can define your own functions. The statement that invokes a function is known as a function call. In calling a function, you can pass arguments to it to perform the desired computation. ...