{ mathlib.py }

This python library is a simple library I've made for math functions. It includes functions such as add, subtract, multiply, divide, area of square, area of circle, and much more. This library was released on September 30, 2018.


Functions

add(a, b) - Adds two given numbers.

subtract(a, b) - Subtracts two given numbers.

multiply(a, b) - Multiplies two given numbers.

divide(a, b) - Divides two given numbers.

square_area(length) - Finds the area of a square with the given length.

rectangle_area(length, width) - Finds the area of a rectangle, given the width and length.

circle_area(radius) - Finds the radius of a circle, given the radius.

triangle_area(length, base) - Finds the area of a triangle, given the length and base.

rectangle_perimeter(length, width) - Finds the rectangle's perimeter, given the length and width.

square_perimeter(side) - Finds the perimeter of the square, given the side length/width.

exponents(number, exponents) - Finds the exponent of a number to a certain power specified.


Usage

Square Area Function

import mathlib
print("The area of a rectangle, with a width of 73, and a length of 832, is " + rectangle_area(73, 832))

Exponent Function

import mathlib
print("2 squared is " + exponents(2, 2))

Divide Function

import mathlib
print("Each person gets " + divide(10, 2) + " cookies")


Source Code

The GitHub link is here: https://github.com/elementzprojects/mathlib