Skip to content

goto, but why? correction #356

Open
Open
@62830

Description

@62830

Hi,

If I'm not mistaken, I think the "goto, but why?" section missed one I am trapped, please rescue! Can you help double check it? (or am I missing some April Fool's joke?)

The code is

from goto import goto, label
for i in range(9):
    for j in range(9):
        for k in range(9):
            print("I am trapped, please rescue!")
            if k == 2:
                goto .breakout # breaking out from a deeply nested loop
label .breakout
print("Freedom!")

The output should be

I am trapped, please rescue!
I am trapped, please rescue!
I am trapped, please rescue!
Freedom!

Instead of

I am trapped, please rescue!
I am trapped, please rescue!
Freedom!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions