os.environ Object Syntax in Python
Syntax: os.environ
Parameter: It is a non-callable object. Hence, no parameter is required
Return Type: This returns a dictionary representing the user’s environmental variables
Python | os.environ object
os.environ
in Python is a mapping object that represents the user’s OS environmental variables. It returns a dictionary having the user’s environmental variable as key and their values as value.
os.environ
behaves like a Python dictionary, so all the common dictionary operations like get and set can be performed. We can also modify os.environ
but any changes will be effective only for the current process where it was assigned and it will not change the value permanently.