Skip to content

A simple interactive command-line calculator in Python with memory, error handling, and extended math operations.

Notifications You must be signed in to change notification settings

FlashyIyke/python-interactive-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

python-interactive-calculator

A simple interactive command-line calculator in Python with memory, error handling, and extended math operations.

Python Interactive Calculator

Project Overview

This is a simple command-line calculator built in Python. It goes beyond the basic + - × ÷ operations by including:

  • Exponentiation (x^y)
  • Square root
  • A memory feature to reuse the last result
  • Error handling to prevent crashes from invalid inputs

The calculator is interactive: after each calculation, it shows a menu and lets the user continue until they type "exit".


Problem Statement

Many beginner calculators stop after a single calculation, forcing the user to restart the program. I wanted to create a lightweight, user-friendly calculator that feels more like a real tool:

  • Continuous usage (menu repeats).
  • Stores past results (memory).
  • Gracefully handles errors (e.g., letters instead of numbers, division by zero).

This project demonstrates modular programming, error handling, and user interaction design in Python.


Features

Addition, subtraction, multiplication, division
Power function (x^y)
Square root function
Memory (reuse last result by typing mem)
Type "exit" anytime to quit
Error handling for invalid inputs


How to Run

  1. Clone the repository:
    git clone https://github.com/your-username/python-interactive-calculator.git
    cd python-interactive-calculator

About

A simple interactive command-line calculator in Python with memory, error handling, and extended math operations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published