title: When to use "while" or "for" in Python
body: <p>I am finding problems in when I should use a <code>while</code> loop or a <code>for</code> loop in Python. It looks like people prefer using a <code>for</code> loop <em>(less code lines?)</em>. Is there any specific situation which I should use one or the other? Is it a matter of personal preference? The codes I have read so far made me think there are big differences between them.</p>