← Back to challenges

Area of a Triangle

PythonEasymathnumbersgeometry

Instructions

Write a function that takes the base and height of a triangle and return its area.

Examples

tri_area(3, 2) ➞ 3

tri_area(7, 4) ➞ 14

tri_area(10, 10) ➞ 50

Notes

  • The area of a triangle is: (base * height) / 2
  • Don't forget to return the result.
  • If you get stuck on a challenge, find help in the Resources tab.
  • If you're really stuck, unlock solutions in the Solutions tab.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Buggy Code (Part 1)