In this tutorial, we will discuss some general concepts on OS Module in Python3.
Before we read about the os module, let’s look at importing of code from one module to another in python. Though there are multiple ways for doing the same, the most common way is to use the import statement.
Import statement handles two major operations:
Search for the named module
Binding the results of named module to a local scope
This allows the modules to have their own copy of functions / variables without any conflict with other modules, although they may have the same name.
The import allows to either import the complete modu...
In the earlier tutorial on functions, you created functions with parameters. In this tutorial, let’s learn more about scope of the variables and how they work with functions. Let's get started.
Scope of variables
Scope defines the visibility or accessibility of the variables defined in the program. In simple words, scope is the container for variables and it determines which section of the code can or can’t access the variable.