Sunday, July 18, 2021

Functions

 It is in the use of functions that Pyhon is admirably concise.

Below, one declares a new function with def; which one is then free to call,

As always, the parenthesis hold the inputs necessary to the function.



*     *     *
Alternatively, once can import a function, using one of two models:



or,



This is the model on which external modules can be used.

In OOP (Object Oriented Programming), creating a class:




Decorators are wrapper functions, useful in Web design so that certain

functionalities are only available if the user is engaged:
 

on the contrary, lambda functions are one-line functions that clarify to the

computer, what we want. And are used in the famous try structures for handling

errors in a way that doesn't crash the program.




                                                                             






No comments: