I agree that the use of else on for and while clauses is very not intuitive. It would be far better if the else would be executed if the list you're iterating over is empty and thus the for/while clause is never ran not even once.<p>So you could rewrite:<p><pre><code> last_val = None
for item in myList:
last_val = item
</code></pre>
to:<p><pre><code> for item in myList:
last_val = item
else:
last_val = None</code></pre>