[BangPypers] Why the None ?
Noufal Ibrahim
noufal at gmail.com
Thu Sep 3 16:52:35 CEST 2009
On Thu, Sep 3, 2009 at 7:27 PM, Abhishek Mishra<ideamonk at gmail.com> wrote:
> Hi, I'm trying to pass 5 as default value for this function...
>
> ------------------------------------------------
> def gimmetaste(length=5):
> print length
>
> if __name__ == '__main__':
> print gimmetaste()
> ------------------------------------------------
check this http://python.pastebin.com/m57fee658
The 5 is from the output of line 2
The None is line 5 printing the return value of gimmetaste. Since
you're not 'return'ing anything, it's Non
--
~noufal
http://nibrahim.net.in
More information about the BangPypers
mailing list