mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +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
|
||||
|
||||
# Enforce precedence with parentheses
|
||||
1 + 3 * 2 # => 7
|
||||
(1 + 3) * 2 # => 8
|
||||
|
||||
# Boolean values are primitives (Note: the capitalization)
|
||||
True
|
||||
False
|
||||
True # => True
|
||||
False # => False
|
||||
|
||||
# negate with not
|
||||
not True # => False
|
||||
|
Loading…
Reference in New Issue
Block a user