Skip to content

Commit c72ec46

Browse files
authored
Merge pull request #387 from pllim/instructor-checkout
Better solution for pre- and post-conditions
2 parents b9322f4 + 5f18d29 commit c72ec46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_episodes/08-defensive.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,9 @@ This violates another important rule of programming:
462462
> > ## Solution
463463
> > ~~~
464464
> > # a possible pre-condition:
465-
> > assert len(input) > 0, 'List length must be non-zero'
465+
> > assert len(input_list) > 0, 'List length must be non-zero'
466466
> > # a possible post-condition:
467-
> > assert numpy.min(input) < average < numpy.max(input), 'Average should be between min and max of input values'
467+
> > assert numpy.min(input_list) <= average <= numpy.max(input_list), 'Average should be between min and max of input values (inclusive)'
468468
> > ~~~
469469
> > {: .python}
470470
> {: .solution}

0 commit comments

Comments
 (0)