Python Lessons - 3.3 Functions arguments m

Python Lessons – 3.3 Functions arguments

This is related to the concept of variable visibility. Variables defined outside the function also have value within the function, the variables used internally to the function do not have visibility outside (can not be used outside) and are destroyed as soon as Execution comes out of the operations inside the function.

Python Lessons - 3.6 Functions as objects m

Python Lessons – 3.6 Functions as objects

In Python Anything can be considered as a variable, even functions. In fact, although it may be very intuitive to start you can assign a function to a variable, in this way it is as if we had given a new name to the variable.

Python Lessons - 3.7 Modules

Python Lessons – 3.7 Modules

Modules are parts of code written by other programmers who perform functions that can be useful in many cases, so reusable in other codes. Each of these modules generally carries out a series of specialized operations in a given field that can be useful to reuse without having to rewrite the code from scratch.

Python Lessons - 4.1 Exceptions m

Python Lessons – 4.1 Exceptions

These exceptions happen when something goes wrong in your code by generating an error. The reasons why these errors are generated can be many, for example due to a resource not found for example a file, or to a value with an incompatible format for a particular operation, etc.

Python Lessons - 4.2 Exception Handling m

Python Lessons – 4.2 Exception Handling

When code execution encounters an error, it throws an exception that stops the program from running. To avoid this you can handle the exception, in order to correct the error, have the possibility to remedy or provide an output information on the nature of the error occurred so then eventually understand the nature and correct the code.

Python Lessons - 4.3 Finally

Python Lessons – 4.3 Finally

In Python There is an additional clause to add to the try-except construct called finally. This clause also defines a specific block of code that will be executed in all cases. That is, the finally block is executed both if the try block is terminated without exception, or if any exception occurred (both managed and unmanaged).