Skip to content

Commit 01858ab

Browse files
authored
Merge pull request #963 from heijer/patch-1
Update 11-debugging.md
2 parents 9a6a0b8 + bf1cef0 commit 01858ab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

_episodes/11-debugging.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ not more.
257257
>
258258
> Use the debugging principles in this exercise and locate problems
259259
> with the code. What suggestions would you give the researcher for
260-
> ensuring any later changes they make work correctly?
260+
> ensuring any later changes they make work correctly? What bugs do you spot?
261261
>
262262
> ~~~
263263
> patients = [[70, 1.8], [80, 1.9], [150, 1.7]]
@@ -280,6 +280,10 @@ not more.
280280
> {: .output}
281281
>
282282
> > ## Solution
283+
> > ### Suggestions for debugging
284+
> > * Add printing statement in the `calculate_bmi` function, like `print('weight:', weight, 'height:', height)`, to make clear that what the BMI is based on.
285+
> > * Change `print("Patient's BMI is: %f" % bmi)` to `print("Patient's BMI (weight: %f, height: %f) is: %f" % (weight, height, bmi))`, in order to be able to distinguish bugs in the function from bugs in the loop.
286+
> > ### Bugs found
283287
> > * The loop is not being utilised correctly. `height` and `weight` are always
284288
> > set as the first patient's data during each iteration of the loop.
285289
> >

0 commit comments

Comments
 (0)