[BangPypers] date range
Vinay Shastry
vinayshastry at gmail.com
Thu Feb 25 04:43:52 CET 2010
On 10 February 2010 09:37, Srinivas Reddy Thatiparthy
<srinivas_thatiparthy at akebonosoft.com> wrote:
>
> It's called TWICE , no matter with or without side effects.
> I asked this on SO,somebody came up with this answer!
>
>>>> def check():
> print 'Called Once'
> return 2
>
>>>> 1<check()<3
> Called Once
> True
>>>> 1<check() and check()<3
> Called Once
> Called Once
> True
>>>>
>
> Happy Hacking.
>
> Regards,
> ~ Srini T
It can be called just once too...
>>> def foo():
... print "called"
... return 0
...
>>> 1 < foo() and foo() < 3
called
False
--
Vinay S Shastry
http://thenub.one09.net
More information about the BangPypers
mailing list