Skip to content

Latest commit

 

History

History
41 lines (24 loc) · 1.4 KB

README.md

File metadata and controls

41 lines (24 loc) · 1.4 KB

Simple Calculator

This is a basic calculator program written in Python that allows you to perform arithmetic operations on two input values. The supported operations are addition (+), subtraction (-), multiplication (*), division (/), and modulus (%).

Usage

  1. Run the program by executing the calculator.py file.
  2. Enter two numerical values separated by a space when prompted.
  3. Choose an operation by entering one of the supported operation symbols: +, -, *, /, or %.
  4. The program will display the result of the chosen operation on the provided values.

How It Works

  1. The program prompts the user to input two numerical values, which are converted to floating-point numbers for accurate calculations.
  2. The user is asked to input an operation symbol.
  3. Based on the chosen operation, the program performs the corresponding calculation and displays the result.

Examples

Enter two values: 10 5
Enter the Operation (+, -, *, /, %): *
10.0 * 5.0 = 50.0

Error Handling

If an invalid operation symbol is provided, the program will display an error message and exit.

Enter two values: 8 3
Enter the Operation (+, -, *, /, %): #
Error: Invalid Operation

Note

This calculator program is a simple demonstration and does not include advanced features such as parentheses, exponentiation, or complex mathematical functions.

Author

@heythakur