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 a function to calculate the area of a triangle given the lengths of its sides.
user
"""
calculate the area of a triangle given the lengths of its sides
"""

def triangle_area(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 

if __name__ == '__main__':
    print("area of triangle is",triangle_area(3,4,5))
assistant