<div dir="ltr"><font color="#330033"><font><font face="georgia,serif">Thank you Wesley, Kal & tutor</font></font></font></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 7, 2013 at 12:07 PM, Kal Sze <span dir="ltr"><<a href="mailto:swordangel@gmail.com" target="_blank">swordangel@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Sunil,<br>
<br>
No method or function in Python has a *static* return type. That's<br>
because Python is by nature a dynamic language, with duck typing and<br>
dynamic dispatch. In fact, any method or function may well return any<br>
of a number of different types:<br>
<br>
    def crazy_function(return_int)<br>
        if return_int:<br>
            return 1<br>
        else:<br>
            return 'foo'<br>
<br>
It's probably bad design, but there is nothing in the Python grammar<br>
and semantics that stops you from doing that.<br>
<br>
So your question is better phrased as: if I don't explicitly return<br>
anything, what is returned?<br>
<br>
The answer to that would be: the None object<br>
<br>
Cheers,<br>
Kal<br>
<div class="im"><br>
On 7 February 2013 14:09, Sunil Tech <<a href="mailto:sunil.techspk@gmail.com">sunil.techspk@gmail.com</a>> wrote:<br>
> If a method has no return type?<br>
> what will it return?<br>
><br>
</div>> _______________________________________________<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" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
><br>
</blockquote></div><br></div>