Skip to content

Advanced Calculator with Continuity , Clear/Back button, Restart button and Exit button. All using Python

Notifications You must be signed in to change notification settings

Ashik-Shaju/Advanced-Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Advanced-Calculator

Advanced Calculator with Continuity , Clear/Back button, Restart button and Exit button. All using Python

Advanced Calculator

Overview

This is an advanced calculator program built in Python that allows users to perform basic arithmetic operations such as addition, subtraction, multiplication, division, and modulus. The program features a user-friendly interface that supports various commands to clear inputs, restart the calculator, or exit the program.

Features

  • Basic Operations: Perform addition, subtraction, multiplication, division, and modulus.
  • Input Flexibility: Enter commands to clear inputs or restart the calculator.
  • Dynamic Result Usage: Option to use the result of the last calculation in subsequent operations.
  • Error Handling: Validates inputs to ensure they are numbers, providing user-friendly error messages.

Getting Started

Prerequisites

  • Python 3.x installed on your machine.

How to Run

  1. Clone the Repository:

    git clone https://github.com/your-username/advanced-calculator.git
    cd advanced-calculator
  2. Run the Program: Open your terminal and execute:

    python calculator.py
  3. Follow the Prompts:

    • Enter numbers when prompted.
    • Choose an operation (+, -, *, /, %).
    • After seeing the result, you can choose to use it in the next calculation, go back to the operation step, restart the calculator, or exit.

Commands

  • C: Clear the current input and return to the first step.
  • CC: Restart the entire calculator session.
  • Y: Use the result of the last calculation as the first number for the next operation.
  • N: Exit the program.

Example Usage

  1. Enter 10 when prompted for the first number.
  2. Choose + as the operation.
  3. Enter 5 as the second number.
  4. The program will display the result: 10 + 5 = 15.
  5. You can choose to use the result in the next calculation by entering Y, or restart with CC, etc.

Error Handling

The program ensures that:

  • Non-numeric inputs are handled gracefully with prompts for valid numbers.
  • Division by zero is explicitly checked and handled.

Contributing

Feel free to contribute to the project by forking the repository and submitting a pull request with your improvements.


About

Advanced Calculator with Continuity , Clear/Back button, Restart button and Exit button. All using Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages