as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
write some code to calculate the area of a triangle given 3 sides.
user
"""
calculate the area of a triangle given 3 sides
"""

def area_triangle(a, b, c): 
    # calculate the semi-perimeter 
    s = (a + b + c) / 2
  
    # calculate the area 
    area = (s * (s-a) * (s-b) * (s-c)) ** 0.5
    return area 
  
# driver code 
# a, b, c are lengths of the sides of triangle
a = 4
b = 5
c = 6
print("area of triangle is : %.2f" % area_triangle(a, b, c))
assistant