Thanks!<br><br>
<div class="gmail_quote">On Wed, Oct 12, 2011 at 8:56 PM, bob gailer <span dir="ltr">&lt;<a href="mailto:bgailer@gmail.com">bgailer@gmail.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>
<div></div>
<div class="h5">On 10/12/2011 8:41 PM, Max S. wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">I&#39;ve been doing some research into C++, and I&#39;ve noticed the for loops.  Is there a way to use the C++ version of the loops instead of the Python one?  For example, I believe that the Python syntax would be:<br>
for a=1, a &lt; 11, a += 1:<br>   print(a)<br>print(&quot;Loop ended.&quot;)<br>if the &#39;for&#39; keyword did it&#39;s function as in C++, Actionscript, or most other programming languages.  Is there a way to do this?<br>
</blockquote><br></div></div>for i in range(1, 11, 1): # the final 1 can be omitted, as it is the default value.<br> loop body<br><br>OR<br><br>i = 1<br>while i &lt; 11:<br> i += 1<br> loop body<br><br>Your choice - that&#39;s all know of - and the for is easier to read and write than the while.<br>
<font color="#888888"><br>-- <br>Bob Gailer<br><a href="tel:919-636-4239" target="_blank" value="+19196364239">919-636-4239</a><br>Chapel Hill NC<br><br></font></blockquote></div><br>