Skip to content

Alvi24-hub/Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Calculator


This is a Python-based command-line calculator that supports both basic and advanced mathematical operations. It allows users to continuously build on previous results and even choose between different types of subtraction and division.


Features

  • Basic operations -> Addition, Subraction(regular and absolute), Multiplication, Division(regular and floor)
  • Regular operations -> Square root, Power, Factorial

How to Use

  1. Start the program: The calculator will prompt you to enter two numbers.
  2. Choose an operation: Select from options 1–5(1–4 for basic operations, 5 for advanced operations)
  3. Advanced operation: Choose an advanced function (sqrt, power, factorial) to apply to the second number. Then choose a basic operation to combine it with the first number.
  4. Chaining: After a calculation, you can add more numbers to the result and keep going!
  5. Exit: When you're done, choose to start over or exit the program.

Example

alt text alt text alt text


Requirements

  • Python 3.13.3+
  • No external libraries are needed (uses Python's built-in math module).

Known Issues

  • Factorial uses math.fac() — this should be changed to math.factorial().
  • Error handling for invalid inputs or division by zero is not implemented yet.
  • Could benefit from input validation and cleaner UI prompts.

Additional Features I Plan On Adding

  • Other advanced features like logarithm, exponential(e) etc.
  • To flexibly perform operation on floating-point numbers too.
  • Avalibility of constants like pi.
  • To perform trigonometric functions

About

A Python-based command-line calculator with basic and advanced math operations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages