Python library for mathematical functions
Project description
MathKit
MathKit is a Python library that provides various mathematical functions and utilities for performing common mathematical calculations.
Example Usage
from mathkit import *
print("Welcome to the Math Library!")
print("1. Addition")
print("2. Subtraction")
print("3. Multiplication")
print("4. Division")
print("5. Modulas")
print("6. Power")
print("7. Square")
print("8. Cube")
print("9. Square Root")
print("10. Cube Root")
print("11. Factorial")
print("12. Percentage")
print("13. LCM")
print("14. HCF")
print("15. Logarithm")
print("16. Exit")
choice = int(input("Enter your choice: "))
if choice == 1:
add() # You can predefine a number by looking at the syntax given below.
elif choice == 2:
sub() # You can predefine a number by looking at the syntax given below.
elif choice == 3:
mul() # You can predefine a number by looking at the syntax given below.
elif choice == 4:
div() # You can predefine a number by looking at the syntax given below.
elif choice == 5:
mod() # You can predefine a number by looking at the syntax given below.
elif choice == 6:
power() # You can predefine a number by looking at the syntax given below.
elif choice == 7:
sqr() # You can predefine a number by looking at the syntax given below.
elif choice == 8:
cube() # You can predefine a number by looking at the syntax given below.
elif choice == 9:
sqrt() # You can predefine a number by looking at the syntax given below.
elif choice == 10:
cbrt() # You can predefine a number by looking at the syntax given below.
elif choice == 11:
fact() # You can predefine a number by looking at the syntax given below.
elif choice == 12:
percent() # You can predefine a number by looking at the syntax given below.
elif choice == 13:
lcm() # You can predefine a number by looking at the syntax given below.
elif choice == 14:
hcf() # You can predefine a number by looking at the syntax given below.
elif choice == 15:
log() # You can predefine a number by looking at the syntax given below.
elif choice == 16:
exit()
else:
print("Invalid choice!")
print("Press Enter to continue")
input()
Example Usage If you decide to predefine numbers
add(5, 3) # Output: Your answer is 8
cbrt(27) # Output: The cube root of 27 is 3.0
div(10, 2) # Output: Your answer is 5.0
fact(5) # Output: The factorial of 5 is 120
hcf(24, 36) # Output: The H.C.F. of 24 and 36 is 12
lcm(12, 18) # Output: The LCM of 12 and 18 is 36
log(100) # Output: Logarithm of 100 (base e) is 4.605...
mod(10, 3) # Output: Your answer is 1
mul(4, 5) # Output: Product = 20
per(50, 10) # Output: 10 percent of 50 is 5
power(2, 3) # Output: The answer is: 8
sqrt(25) # Output: Square root of 25 is 5.0
sqr(4) # Output: The square of 4 is 16
sub(8, 3) # Output: Your answer is 5
For more information, please visit the GitHub repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mathkit-2.15.2.tar.gz
(3.6 kB
view hashes)