File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ def normalize_rectangle(rect):
131131~~~
132132{: .python}
133133
134- The preconditions on lines 2, 4 , and 5 catch invalid inputs:
134+ The preconditions on lines 3, 5 , and 6 catch invalid inputs:
135135
136136~~~
137137print(normalize_rectangle( (0.0, 1.0, 2.0) )) # missing the fourth coordinate
@@ -177,7 +177,7 @@ AssertionError: Invalid X coordinates
177177~~~
178178{: .error}
179179
180- The post-conditions help us catch bugs by telling us when our calculations cannot have been correct.
180+ The post-conditions on lines 17 and 18 help us catch bugs by telling us when our calculations cannot have been correct.
181181For example,
182182if we normalize a rectangle that is taller than it is wide everything seems OK:
183183
@@ -217,7 +217,7 @@ AssertionError: Calculated upper Y coordinate invalid
217217{: .error}
218218
219219Re-reading our function,
220- we realize that line 10 should divide ` dy ` by ` dx ` rather than ` dx ` by ` dy ` .
220+ we realize that line 11 should divide ` dy ` by ` dx ` rather than ` dx ` by ` dy ` .
221221(You can display line numbers by typing Ctrl-M, then L.)
222222If we had left out the assertion at the end of the function,
223223we would have created and returned something that had the right shape as a valid answer,
You can’t perform that action at this time.
0 commit comments