python "jump" or "goto" commands?

Micah Cowan micah at cowanbox.com
Wed May 30 19:18:35 EDT 2001


brakedon at hotmail.com (eric_brake) writes:

> I'd like to know if python has commands similar to "jump" or "goto".
> I've been using "while" loops to do the job, but i think if I could
> use a "jump" command it would take less code. And I could also execute
> any part of my code depending on a boolean operator.

Python gives no goto or jump, but using gotos in any language instead
of a while loop is usually not only /more/ code, but is indicative of
a very sloppy design.

The only thing I ever use goto for in C is for handling exceptions.
Python eliminates this need with try/except.

Have you never heard of structured programming?

Micah



More information about the Python-list mailing list