Another question could be: why is there not a statement "whileTrue" or "loop"?<br>

<br>

For exemple:<br>

<br>

whileTrue:<br>

    statement 1<br>

    if condition:<br>

        break<br>

    statement 2<br>

<br>

<br>

It could be an economy of one unuseful test by loop.<br><br><div><span class="gmail_quote">On 6/21/05, <b class="gmail_sendername">Magnus Lycka</b> <<a href="mailto:lycka@carmen.se">lycka@carmen.se</a>> wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Remi Villatel wrote:<br>> while True:<br>>     some(code)<br>>     if final_condition is True:
<br>>         break<br>>     #<br>> #<br>><br>> What I don't find so "nice" is to have to build an infinite loop only to<br>> break it.<br><br>This is a common Python idiom. I think you will get used to it.
<br><br><br>> Is there a better recipe?<br><br>final_condition = False<br>while not final_condition:<br>     some(code)<br>--<br><a href="http://mail.python.org/mailman/listinfo/python-list">http://mail.python.org/mailman/listinfo/python-list
</a><br></blockquote></div><br>