# How do I access environment variables in Python?

You can access environment variables in Python using the `os` module.

Here's an example:

```python
import os

# Access an environment variable
value = os.environ['VARIABLE_NAME']

# Set an environment variable
os.environ['VARIABLE_NAME'] = 'value'
```

You can also use the `os.getenv` function to get the value of an environment variable. This function takes the name of the environment variable as an argument and returns the value of the variable as a string:

```python
import os

value = os.getenv('VARIABLE_NAME')
```

If the environment variable is not set, `os.getenv` returns `None`. You can also specify a default value to be returned if the environment variable is not set:

```python
import os

value = os.getenv('VARIABLE_NAME', 'default_value')
```

This can be useful if you want to use a default value if the environment variable is not set.