# Walrus Operator

say it: **“WAWL-rus OP-uh-ray-ter”** **/ˈwɔlrəs ˈɑpəˌreɪtɚ/**

The := operator: saves a value and uses it in the same line.

## What is the **walrus operator**?

The **walrus operator** (`:=`) saves a value into a variable and uses it in the same line, so you don't have to work it out twice.

```python
while (answer := input("Command (q to quit): ")) != "q":
    print("You typed", answer)
```

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

Updated: November 17, 2026

Source: https://www.ask-codey.com/glossary/walrus-operator
