Skip to content

ERYXGF/smart_calculator_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🧮 Smart Calculator

A feature-rich command-line calculator built in Python that handles all standard arithmetic operations, maintains a session history, and manages all edge cases gracefully without crashing.


✨ Features

  • Addition, subtraction, multiplication, division
  • Exponentiation and modulo operations
  • Square root operations
  • Full input validation — handles letters, empty input, division by zero
  • Session history — view every calculation performed
  • Clear history command
  • Save History to file feature
  • Clean, intuitive menu-driven interface
  • Continuous session loop — calculate as many times as you want

🚀 Getting Started

Prerequisites

  • Python 3.8 or higher

Installation & Run

git clone https://github.com/ERYXGF/smart_calculator_python.git cd smart-calculator python main.py

No external dependencies — standard library only.


🕹 How to Use

Run the program and select an operation from the menu by entering its number. Enter your two values when prompted. After each result you can continue calculating, view, clear or save your history, and quit.


🛠 Built With

  • Python 3.11
  • Standard library only (math module)

📚 What I Learned

  • Structuring a project across multiple files with clean imports
  • Robust input validation using try/except blocks
  • Managing application state (history) using lists
  • Building intuitive menu-driven CLI applications
  • Break down a bigger project into smaller subsections
  • "Link" many smaller functions into one "directorial" function
  • Name git commits appropriately
  • Handling arithmetic edge cases like division by zero

🗺 Future Improvements

  • Chain calculations using the previous result
  • Logarithm operations
  • GUI version using tkinter
  • Integrate colours and a cleaner display in the terminal

📄 Licence

MIT Licence — see LICENSE for details.

Project 1 of 12 — Python learning roadmap

About

This is a smart calculator that can perform additions, substractions, multiplication, division, exponentiation, modulation and quit. Also has a history, chain calculation, and a sqrt option.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages