Re: function/method assigment

2007-04-13 Thread 7stud
On Apr 13, 10:14 am, [EMAIL PROTECTED] wrote: > what is the > meaning of 'None'? > It's a value just like any other python value: 2, 7.5, "red", and it evaluates to false in a conditional: my_var = None if not my_var: print "bad data" -- http://mail.python.org/mailman/listinfo/python-list

Re: function/method assigment

2007-04-13 Thread 7stud
On Apr 13, 10:14 am, [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 > > >>>

Re: function/method assigment

2007-04-13 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > I have a confusion when I do some practice, the code and output are as > following, > def fun(): > print 'In fun()' Function fun doesn't explicitelly return something, so it's return value defaults to None (nb: None is a builtin object representing 'no

Re: function/method assigment

2007-04-13 Thread Jakub Stolarski
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 > > > >

Re: function/method assigment

2007-04-13 Thread Steve Holden
[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 > print testfun2() > In fu

function/method assigment

2007-04-13 Thread viscroad
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 >>> print testfun2() In fun() None >>> what is 'testfun'? Why it is 'N