> For the complete documentation index, see [llms.txt](https://kallyasmedia.gitbook.io/cit-python-cohort-three/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kallyasmedia.gitbook.io/cit-python-cohort-three/week2/break_and_continue.md).

# Control Flow / Break And Continue

Use `break` to exit a loop early. Use `continue` to skip the rest of the current iteration and move to the next.

## `break`

```python
for letter in "Python":
    if letter == "h":
        break
    print(letter)
```

Output:

```
P
y
t
```

## `continue`

```python
for letter in "Python":
    if letter == "h":
        continue
    print(letter)
```

Output:

```
P
y
t
o
n
```

## Common Pitfalls

* Using `break` when you meant `return` inside a function.
* Using `continue` and accidentally skipping necessary updates.

[Previous](/cit-python-cohort-three/week2/while_loops.md)
