<p><br>
On Dec 11, 2011 8:41 AM, &quot;Pete O&amp;apos;Connell&quot; &lt;<a href="mailto:pedrooconnell@gmail.com">pedrooconnell@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi I have been writing python code for a while now and I never return anything within any of my functions, I just (eg.) print stuff or make directories or update a log or what have you. When I look at other people&#39;s code they are always returning in their functions and I was wondering if someone could give me an example of when I would absolutely have to return something. The thing I don&#39;t like about returning is that when I unindent a function and try to run the code to inspect parts of it for debugging I always have to alter the code so as not to get the &quot;return not inside a function error&quot;,  so I will change the word &quot;return&quot; to &quot;print&quot; and in many cases that&#39;s the way I leave it. Anyone have any thoughts on this?<br>

&gt;</p>
<p>No one has mentioned it so far, but the interactive interpreter is what you should use for debugging short code snippets.  I always program with two windows open - one with my editor and one with the interpreter. This lets me try out short bits of code without running my whole program.</p>

<p>Hth,<br>
Wayne <br>
&gt; Thanks<br>
&gt; Pete<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Tutor maillist  -  <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
&gt; To unsubscribe or change subscription options:<br>
&gt; <a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a><br>
&gt;<br>
</p>