#2
wp2319572022-06-25 12:39
回复 楼主 Z89
|
程序代码:
from goto import with_goto
@with_goto
def range(start, stop):
i = start
result = []
label .begin
if i == stop:
goto .end
result.append(i)
i += 1
goto .begin
label .end
return result
a= range(0,10)
print(a)
@with_goto
def range(start, stop):
i = start
result = []
label .begin
if i == stop:
goto .end
result.append(i)
i += 1
goto .begin
label .end
return result
a= range(0,10)
print(a)
程序代码:
from goto import with_goto
@with_goto
i = 0
result = []
label .begin
if i == 10:
goto .end
result.append(i)
i += 1
goto .begin
label .end
print(result)