[Tutor] Using goto or labels in Python?

Alan Gauld alan.gauld at btinternet.com
Wed Feb 11 19:14:13 CET 2015


On 11/02/15 10:44, Raphael Raphael wrote:
> Hello,

Hello, please do not post the entire digest to ask a new question.
Some people pay by the byte.
Just send a new mail to tutor at python.org.


> Is there a way in which people have found to use goto or labels in Python?thank you.

No. Python does not have a goto because using goto is
considered bad programming practice and is never necessary
(although *very* occasionally it can be simpler and clearer
to use goto IMHO).

What are you trying to do that you think needs a goto and we
can see if there is a clearer way to write it without goto.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list