Logical AND question

3c273 nospam at nospam.com
Thu May 13 11:53:54 EDT 2004


Hello,
Can someone explain to me why only one of these two if/print statements
prints something? Thanks!
Louis

IDLE 1.0.2
>>> s = ''
>>> t = ''
>>> if s and t == '':
 print "This doesn't work!"


>>> s and t
''
>>> if s == '' and t == '':
 print "This does!"


This does!
>>>





More information about the Python-list mailing list