Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
reducing solution in Clear category for Simple Areas by new_hoschi
from functools import reduce
import math
def simple_areas(*args):
if len(args)==1:
return math.pi*(args[0]/2)**2
elif len(args)==2:
return reduce(lambda x,y: x * y, args)
else:
s=sum(args)/2
return (s*reduce(lambda x,y:x*y,[s-j for j in args]))**.5
July 6, 2020
Comments: