Modify Heron’s Formula¶

Modify herons_formula.py to include a check to ensure the lengths of sides a, b, and c are valid lengths for a triangle. Raise the appropriate error if they are not.

  1. Obviously, triangles cannot have negative side-lengths or side-lengths of 0.

  2. Not so obvious, certain length combinations are not possible triangles. For example having side lengths of 100, 1, and 1 wouldn’t create a triangle.


©2021 Daniel Gallo

This work is licensed under Attribution-NonCommercial-ShareAlike 4.0 International