Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Simple Areas by McRawicz
def simple_areas(*args):
import math
if len(args)==1:
return round(3.14159265*args[0]*args[0]/4,2)
elif len(args)==2:
return round(args[0]*args[1],2)
else:
p=(args[0]+args[1]+args[2])/2
return round(math.sqrt(p*(p-args[0])*(p-args[1])*(p-args[2])),2)
Nov. 9, 2016