Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Jump-anywhere/Python/jump-anywhere.py
Normal file
13
Task/Jump-anywhere/Python/jump-anywhere.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# Example 2: Restarting a loop:
|
||||
from goto import goto, label
|
||||
label .start
|
||||
for i in range(1, 4):
|
||||
print i
|
||||
if i == 2:
|
||||
try:
|
||||
output = message
|
||||
except NameError:
|
||||
print "Oops - forgot to define 'message'! Start again."
|
||||
message = "Hello world"
|
||||
goto .start
|
||||
print output, "\n"
|
||||
Loading…
Add table
Add a link
Reference in a new issue