Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The `break` statement will completely break out of the *current loop*, meaning i


```python
>>> names = ["Rose", "Max", "Nina", "Phillip"]
>>> for name in names:
... print(f"Hello, {name}")
... if name == "Nina":
Expand Down Expand Up @@ -119,6 +120,7 @@ Nina in outer loop
You can also use `break` and `continue` in `while` loops. One common scenario is running a loop forever, until a certain condition is met.

```python
>>> count = 0
>>> while True:
... count += 1
... if count == 5:
Expand Down Expand Up @@ -148,4 +150,4 @@ Just like in functions, consider the `return` statement the hard kill-switch of
Max
Nina
'Found the special name'
```
```