def square_area(side): """ Calculate area of a square from side length. @param side: the side length @return: the area (units^2 from side) >>> square_area(4) 16 """ if dim_validate(side): return side*side else: raise ValueError("side is les than 0: "+str(side))
def square_perimeter(side: Number) -> Number: """ Calculate perimeter of a square from side length. @param side: the side length @return: the perimeter (same units as side length) >>> square_perimeter(4) 16 """ if dim_validate(side): return 4*side else: raise ValueError("side is les than 0: "+str(side))