mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
31 lines
365 B
Markdown
31 lines
365 B
Markdown
---
|
|
icon: dot
|
|
title: Goto Statement
|
|
---
|
|
|
|
pkpy supports goto/label just like C. You are allowed to **change the control flow unconditionally**.
|
|
|
|
## Define a label
|
|
|
|
```
|
|
== <identifier> ==
|
|
```
|
|
|
|
## Goto a label
|
|
|
|
```
|
|
-> <identifier>
|
|
```
|
|
|
|
## Example
|
|
|
|
```python
|
|
for i in range(10):
|
|
for j in range(10):
|
|
for k in range(10):
|
|
-> exit
|
|
|
|
== exit ==
|
|
print('exit')
|
|
```
|