Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. ## Area of a triangle
  2. """
  3. S = (a + b + c) / 2
  4. area = sqrt(s(s-a)(s-b)(s-c))
  5. """
  6.  
  7. a = float(input("Enter a: "))
  8. b = float(input("Enter b: "))
  9. c = float(input("Enter c: "))
  10.  
  11. #calculate the semi-perimeter
  12. s = (a + b + c) / 2
  13. #calculate the area
  14. area = (s*(s-a)*(s-b)*(s-c)) ** 0.5
  15. print("the area of triangle is %0.2f" %area )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement