On 4 May 2007 03:02:37 -0700, Jaswant <[EMAIL PROTECTED]> wrote:
> This is  a simple way to do it i think
>
>
> s=hello
>
> >>> if(len(s)==0):
> ....     print "Empty"
> .... else:
> ....     print s
> ....
> hello

Not as simple as   " If not s: "

and nowhere near as simple as  "  print s or 'Empty'  "   :) :)


>>> s = ''
>>> print s or 'Empty'
Empty
>>> s = 'hello'
>>> print s or 'Empty'
hello
>>>
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to