human
Give me a Python code to find the area of the largest triangle that can be inscribed in a semicircle with a given radius given the following:
Write a python function to find the area of the largest triangle that can be inscribed in a semicircle with a given radius. Here is a solution in Python:
assistant
#Here is Python code to find the area of the largest triangle that can be inscribed in a semicircle with a given radius.
 def triangle_area(r) :  
    if r < 0 : 
        return None
    return r * r