# Nested Loop

say it: **“NES-tid loop”** **/ˈnɛstɪd lup/**

A loop inside another loop.

## What is a **nested loop**?

A **nested loop** is a loop inside another loop. The inner loop runs all the way through for every pass of the outer one.

```python
for row in ["A", "B"]:
    for seat in [1, 2]:
        print(f"{row}{seat}")   # A1 A2 B1 B2
```

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

Updated: November 17, 2026

## In other subjects

- [Nested Loop in C#](https://www.ask-codey.com/glossary/nested-loop-c-sharp)
- [Nested Loop in Java](https://www.ask-codey.com/glossary/nested-loop-java)
- [Nested Loop in JavaScript](https://www.ask-codey.com/glossary/nested-loop-javascript)
- [Nested Loop in Software Development](https://www.ask-codey.com/glossary/nested-loop-software-development)

Source: https://www.ask-codey.com/glossary/nested-loop
