Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Basic solution in Clear category for Simple Areas by Phil15
from math import pi, sqrt
def simple_areas(*args):
if len(args)==1:
return pi*args[0]**2/4
elif len(args)==2:
return args[0]*args[1]
else: #Heron's formula
a, b, c = args
s = (a+b+c)/2
return sqrt(s*(s-a)*(s-b)*(s-c))
April 6, 2018
Comments: