Algebra Maximum Value In Python