diff options
author | Adam Bard <github@adambard.com> | 2013-06-28 19:56:09 -0700 |
---|---|---|
committer | Adam Bard <github@adambard.com> | 2013-06-28 19:56:09 -0700 |
commit | 4f50dedd5c59e530c680d50399fb6a4196827c2f (patch) | |
tree | 47d94adc31499098e9518be3945d2022e9a51e81 | |
parent | d1e222727a612daffdda27394265d1c302958406 (diff) | |
parent | cf98f74d6147e1aded5a863298f9cb1446d5da23 (diff) |
Merge pull request #23 from brianr/patch-1
Use consistent example for demonstrating integer vs. float division
-rw-r--r-- | python.html.markdown | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/python.html.markdown b/python.html.markdown index a17b7645..4cfecbbd 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -34,11 +34,11 @@ to Python 2.x. Look for another tour of Python 3 soon! # Division is a bit tricky. It is integer division and floors the results # automatically. -11 / 4 #=> 2 +5 / 2 #=> 2 # 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 |