mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-24 05:20:17 +00:00
325 B
325 B
| icon | title |
|---|---|
| dot | Increment Statement |
pkpy provides ++i and --j statements to operate a simple named int variable.
++iis equivalent toi+=1, but much faster--jis equivalent toj-=1, but much faster
Example
a = 1
++a
assert a == 2
def f(a):
--a
return a
assert f(3) == 2