Skip to content

Adityatiwari1981/python-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

# ๐Ÿงฎ Simple Calculator with History (Python) #

A beginner-friendly Python calculator project that performs basic arithmetic operations and stores calculation history in a file.


๐Ÿ“Œ Project Overview :

This project is a simple command-line calculator built using Python. It allows users to perform basic mathematical operations such as addition, subtraction, multiplication, and division.
It also includes a history feature that saves all calculations in a text file and allows users to view or clear the history anytime.


Features :

  • โž• Addition
  • โž– Subtraction
  • โœ–๏ธ Multiplication (supports * and x)
  • โž— Division with zero-division handling
  • ๐Ÿ“œ View calculation history
  • ๐Ÿ—‘๏ธ Clear calculation history
  • โŒจ๏ธ Shortcut commands for fast usage

Technologies Used :

  • Python
  • File Handling
  • OS Module
  • Command Line Interface (CLI)

๐Ÿ“‚ Project Structure :

Simple-Calculator/
โ”‚
โ”œโ”€โ”€ main.py
โ”œโ”€โ”€ History.txt
โ””โ”€โ”€ README.md

๐Ÿš€ How to Run the Project :

  1. Make sure Python is installed on your system
  2. Clone this repository
  3. Open terminal in project folder
  4. Run the command :
python main.py

โŒจ๏ธ Commands Used :

Command Action
? Show calculation history
- Clear history
q Exit program

๐Ÿ“ Example Usage :

Enter calculation or command: 10+5
Result: 15

Enter calculation or command: ? 10+5=15

Enter calculation or command: - Your history has been cleared.


๐Ÿ“ˆ Learning Outcomes :

  • Understanding Python functions
  • File handling (read, write, append)
  • Error handling using try-except
  • Basic input validation
  • Building CLI-based projects

Author :

Aditya Tiwari
MCA Student
Passionate about learning programming and building real-world projects.


Feedback :

If you like this project, feel free to โญ star the repository and share your feedback.

About

A simple Python-based command-line calculator that performs basic arithmetic operations like addition, subtraction, multiplication, and division. It also includes a history feature to store, view, and clear past calculations using file handling and user-friendly commands.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages