# Environment Variable

*noun*

say it: **“en-VY-run-ment VAIR-ee-uh-bul”** **/ɛnˈvaɪrənmənt ˈvɛəriəbəl/**

A named setting kept outside a program, in the computer or server it runs on, where secrets such as API keys and passwords belong.

## What is an **environment variable**?

An **environment variable** is a setting stored outside your code, in the computer or server, which is the safe place for passwords and API keys.

```python
import os
api_key = os.environ.get("WEATHER_API_KEY")
if api_key is None:
    print("Set WEATHER_API_KEY first")
```

## In a sentence

- “On Render, Neha set the **environment variable** DATABASE_URL in the dashboard.”
- “The JWT secret comes from an **environment variable**, never from the code.”

Level: Journeyman · [More Python terms at this level](https://www.ask-codey.com/glossary?category=python&level=3)

Updated: November 19, 2026

## In other subjects

- [Environment Variable in Operating System](https://www.ask-codey.com/glossary/environment-variable-operating-system)
- [Environment Variable in Unix](https://www.ask-codey.com/glossary/environment-variable-unix)

Source: https://www.ask-codey.com/glossary/environment-variable
