What's True in Python : True « Data Type « Python






What's True in Python



#      0 is false; all other numbers are true.

#      An empty string ("") is false, all other strings are true.

#      An empty list ([]) is false; all other lists are true.

#      An empty tuple (()) is false; all other tuples are true.

#      An empty dictionary ({}) is false; all other dictionaries are true.

           
       








Related examples in the same category

1.1 is true in Python1 is true in Python