You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
fromgotoimportgoto, labelforiinrange(9):
forjinrange(9):
forkinrange(9):
print("I am trapped, please rescue!")
ifk==2:
goto .breakout# breaking out from a deeply nested looplabel .breakoutprint("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!
The text was updated successfully, but these errors were encountered:
Hi! I’ve double-checked the code and the explanation in the "goto, but why?" section.
You are correct—the expected output in the documentation is missing one I am trapped, please rescue!. The correct output should be:
I am trapped, please rescue!
I am trapped, please rescue!
I am trapped, please rescue!
Freedom!
The missing line occurs because the print("I am trapped, please rescue!") statement is executed three times (for k = 0, 1, 2) before the goto statement breaks out of the loop. It seems like a simple oversight in the documentation.
Hey @62830 , thanks for discovering an issue. Do you wish to make the changes? We are in progress of redesigning wtfpython and you could help us a lot.
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
The output should be
Instead of
The text was updated successfully, but these errors were encountered: