mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-26 20:34:32 +03:00
[python/zh-cn] Empty tuple is also False (#4297)
This commit is contained in:
parent
fd3b5cf629
commit
93af05dc04
@ -129,12 +129,13 @@ None # => None
|
||||
"etc" is None # => False
|
||||
None is None # => True
|
||||
|
||||
# None,0,空字符串,空列表,空字典都算是False
|
||||
# None,0,空字符串,空列表,空字典,空元组都算是False
|
||||
# 所有其他值都是True
|
||||
bool(0) # => False
|
||||
bool("") # => False
|
||||
bool([]) # => False
|
||||
bool({}) # => False
|
||||
bool(()) # => False
|
||||
|
||||
|
||||
####################################################
|
||||
|
Loading…
Reference in New Issue
Block a user