On 10 February 2010 09:37, Srinivas Reddy Thatiparthy <srinivas_thatipar...@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 _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers