maynul67

math triangle calculator

Jul 13th, 2021
549
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import math
  2. def triangle_area(a,b,c):
  3.     s = (a+b+c)/2
  4.     hp = s*(s-a)*(s-b)*(s-c)
  5.     return math.sqrt(hp)
  6.      
  7. a = int(input("enter side 1: "))
  8. b = int(input("enter side 2: "))
  9. c = int(input("enter side 3: "))
  10. area = triangle_area(a,b,c)
  11. print(area)
RAW Paste Data