mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-22 23:01:41 +03:00
Use consistent example for demonstrating integer vs. float division
This commit is contained in:
parent
6f255a5e62
commit
cf98f74d61
@ -36,7 +36,7 @@ to Python 2.x. Look for another tour of Python 3 soon!
|
||||
|
||||
# To fix division we need to learn about floats.
|
||||
2.0 # This is a float
|
||||
5.0 / 2.0 #=> 2.5 ahhh...much better
|
||||
11.0 / 4.0 #=> 2.75 ahhh...much better
|
||||
|
||||
# Enforce precedence with parentheses
|
||||
(1 + 3) * 2 #=> 8
|
||||
|
Loading…
Reference in New Issue
Block a user