Convex Functions In Python With Return