mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-23 06:03:07 +03:00
[python] == doesn't coerce types; use bool() to demonstrate truthiness instead. Closes #418.
This commit is contained in:
parent
77facdeafe
commit
1e60055977
@ -105,8 +105,8 @@ None is None #=> True
|
|||||||
|
|
||||||
# None, 0, and empty strings/lists all evaluate to False.
|
# None, 0, and empty strings/lists all evaluate to False.
|
||||||
# All other values are True
|
# All other values are True
|
||||||
0 == False #=> True
|
bool(0) #=> False
|
||||||
"" == False #=> True
|
bool("") #=> False
|
||||||
|
|
||||||
|
|
||||||
####################################################
|
####################################################
|
||||||
|
Loading…
Reference in New Issue
Block a user