1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-14 02:34:17 +02:00

Merge pull request #4467 from s-spindler/patch-2

[python/en-us] add sets to empty things that are false
This commit is contained in:
Marcel Ribeiro Dantas, Ph.D
2022-07-28 10:14:55 +02:00
committed by GitHub

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