mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Explaining better and improving consistence
Added a version without parentheses to make it clear what they are doing; Added return values for True and False because 3 also has it.
This commit is contained in:
parent
f1d03b0318
commit
9e8184f455
@ -58,11 +58,12 @@ Note: This article applies to Python 3 specifically. Check out [here](http://lea
|
|||||||
2**3 # => 8
|
2**3 # => 8
|
||||||
|
|
||||||
# Enforce precedence with parentheses
|
# Enforce precedence with parentheses
|
||||||
|
1 + 3 * 2 # => 7
|
||||||
(1 + 3) * 2 # => 8
|
(1 + 3) * 2 # => 8
|
||||||
|
|
||||||
# Boolean values are primitives (Note: the capitalization)
|
# Boolean values are primitives (Note: the capitalization)
|
||||||
True
|
True # => True
|
||||||
False
|
False # => False
|
||||||
|
|
||||||
# negate with not
|
# negate with not
|
||||||
not True # => False
|
not True # => False
|
||||||
|
Loading…
Reference in New Issue
Block a user