Skip to content

Latest commit

 

History

History
7 lines (4 loc) · 335 Bytes

File metadata and controls

7 lines (4 loc) · 335 Bytes

Write a function triangle_area(base: float, height: float) -> float that calculates the area of a triangle given its base and height. The area of a triangle can be calculated using the formula:

Area = 1/2 x base x height.

For example:

  • triangle_area(10.0, 5.0) → 25.0 because the area of the triangle is 0.5 * 10 * 5.