This commit is contained in:
blueloveTH 2023-09-24 13:50:59 +08:00
parent dd6e8fab9b
commit ffbb9af45e
2 changed files with 16 additions and 1 deletions

View File

@ -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
```

View File

@ -19,4 +19,15 @@ for i in range(10): # [1]
-> out
b = True
== out ==
assert not b
assert not b
sum = 0
i = 1
== loop ==
sum += i
i += 1
if i <= 100:
-> loop
assert sum == 5050