A powerful console-based calculator written in Python. Supports basic arithmetic, bitwise logic, trigonometry, statistics, cryptographic hashing, base conversions, combinatorics, and secure lambda-based evaluation engine.
-
All functions are accessible through intuitive symbols
-
Includes 36 operations
-
Allows safe evaluation of custom expressions with lambda
-
Colored output for better readability
To display the general help, just enter ?
during calculator use.
-
colorama (for colored terminal output)
pip install colorama
Open a terminal in the project folder and run:
python main.py
Key | Function | Example Expression |
---|---|---|
+ |
Addition | 2 + 3 |
- |
Subtract | 10 - 4 |
* |
Multiply | 6 * 9 |
/ |
Divide | 20 / 5 |
^ |
Power | 2 ** 3 |
r |
Root | 16 ** (1/2) for √16 |
% |
Percent of | (20 / 100) * 200 |
m |
Modulo | 10 % 3 |
l |
Logarithm | math.log(8, 2) |
e |
Exponent | math.exp(1) |
g |
GCD | math.gcd(20, 12) |
i |
Mod Inverse | pow(3, -1, 11) |
p |
Permutation | math.perm(5, 2) |
k |
Combination | math.comb(5, 2) |
s |
Sine | math.sin(math.pi/2) |
c |
Cosine | math.cos(0) |
t |
Tangent | math.tan(math.pi/4) |
! |
Factorial | math.factorial(5) |
x |
XOR | 5 ^ 3 |
< |
Rotate Left | (x << y) │ (x >> (bits - y)) |
> |
Rotate Right | (x >> y) │ (x << (bits - y)) |
o |
Round | round(3.1415, 2) |
& |
Random (RNG) | random.randint(1, 10) |
b |
Binary | bin(10) |
8 |
Octal | oct(10) |
h |
Hexadecimal | hex(255) |
f |
From Base | int('1010', 2) |
5 |
MD5 Hash | hashlib.md5(b"hello").hexdigest() |
6 |
SHA256 Hash | hashlib.sha256(b"hello").hexdigest() |
a |
Average | sum([1, 2, 3, 4]) / len([1, 2, 3, 4]) |
# |
Median | statistics.median([1, 3, 2, 4]) |
$ |
Lambda (safe eval) | eval("sin(pi / 2)", {"__builtins__":{}}, ...) |
3 |
Quadratic Formula | quadratic(1, -3, 2) → roots of x²-3x+2 |
d |
Date Now | int(time.time()) |
q |
Quit | Exit program |
? |
Help | Show help menu |