Как выйти из предложения if

from goto import goto, label

if some_condition:
   ...
   if condition_a:
       # do something
       # and then exit the outer if block
       goto .end
   ...
   if condition_b:
       # do something
       # and then exit the outer if block
       goto .end
   # more code here

label .end

(Не используйте это, пожалуйста.)

program-flow

python

control-flow

2022-11-14T00:42:49+00:00