1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-06 06:47:54 +02:00

Add sets to empty things that are false

This commit is contained in:
Stephan Spindler
2022-07-27 21:38:53 +02:00
committed by GitHub
parent ae7233323b
commit adc474c4c9

View File

@@ -153,13 +153,14 @@ None # => None
"etc" is None # => False
None is None # => True
# None, 0, and empty strings/lists/dicts/tuples all evaluate to False.
# None, 0, and empty strings/lists/dicts/tuples/sets all evaluate to False.
# All other values are True
bool(0) # => False
bool("") # => False
bool([]) # => False
bool({}) # => False
bool(()) # => False
bool(set()) # => False
####################################################
## 2. Variables and Collections