On Apr 13, 6:14 pm, [EMAIL PROTECTED] wrote:
> I have a confusion when I do some practice, the code and output are as
> following,
>
> >>> def fun():
>
>         print 'In fun()....'
>
> >>> testfun = fun()
> In fun()....
> >>> print testfun
> None
> >>> testfun2 = fun
> >>> print testfun2
>
> <function fun at 0x00CC1270>
> >>> print testfun2()
>
> In fun()....
> None
>
>
>
> what is 'testfun'? Why it is 'None'? And print testfun2(), what is the
> meaning of 'None'?
>
> Thanks!

Your 'fun' is the sam as:

def fun():
  print 'In fun()....'
  return None

So
testfun = fun()

First prints message and then assign None to testfun.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to