mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
...
This commit is contained in:
parent
dd6e8fab9b
commit
ffbb9af45e
@ -5,6 +5,10 @@ title: Goto Statement
|
||||
|
||||
pkpy supports goto/label just like C. You are allowed to **change the control flow unconditionally**.
|
||||
|
||||
!!!
|
||||
This feature is stable after v1.2.2.
|
||||
!!!
|
||||
|
||||
## Define a label
|
||||
|
||||
```
|
||||
|
@ -20,3 +20,14 @@ for i in range(10): # [1]
|
||||
b = True
|
||||
== out ==
|
||||
assert not b
|
||||
|
||||
sum = 0
|
||||
i = 1
|
||||
|
||||
== loop ==
|
||||
sum += i
|
||||
i += 1
|
||||
if i <= 100:
|
||||
-> loop
|
||||
|
||||
assert sum == 5050
|
Loading…
x
Reference in New Issue
Block a user