Ralf Schoenian <r...@schoenian-online.de> writes: > yes, the following evaluates to False: > empty String: '' > empty list: [] > empty tuple: () > empty dict: {} > 0, None > and False of course
More precisely: All the above evaluate as Boolean false. But only one of them evaluates to False: the object bound to the name ‘False’. >>> bool(None) == bool(False) True >>> None == False False >>> None is False False >>> bool('') == bool(False) True >>> '' == False False >>> '' is False False >>> bool(0) == bool(False) True >>> 0 == False False >>> 0 is False False -- \ “What is it that makes a complete stranger dive into an icy | `\ river to save a solid gold baby? Maybe we'll never know.” —Jack | _o__) Handey | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list