<p><br>
On Dec 11, 2011 8:41 AM, "Pete O&apos;Connell" <<a href="mailto:pedrooconnell@gmail.com">pedrooconnell@gmail.com</a>> wrote:<br>
><br>
> 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'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'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 "return not inside a function error", so I will change the word "return" to "print" and in many cases that's the way I leave it. Anyone have any thoughts on this?<br>
></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>
> Thanks<br>
> Pete<br>
><br>
><br>
> _______________________________________________<br>
> Tutor maillist - <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
> To unsubscribe or change subscription options:<br>
> <a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a><br>
><br>
</p>