Skip to content

Sam3360/Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Simple Command-Line Calculator

This repository contains a straightforward, single-run command-line calculator program written in Python. It's designed as a beginner-friendly project to demonstrate fundamental arithmetic operations and basic user interaction in a console environment.

✨ Features

  • Addition (+): Adds two numbers.
  • Subtraction (-): Subtracts the second number from the first.
  • Multiplication (*): Multiplies two numbers.
  • Division (/): Divides the first number by the second, with basic error handling for division by zero.
  • User-Friendly: Prompts the user for inputs and operation choice.

πŸš€ How to Use

To run this calculator, you'll need Python installed on your computer.

Prerequisites

  • Python 3.x (Download and install the latest Python 3 version if you don't have it.)

Running the Calculator

  1. Save the code:

    • Save the calculator code (from our conversation) into a file named my_calculator.py. Make sure it's in a folder you can easily find (e.g., your Desktop or a dedicated github_projects folder).
  2. Open your Command Prompt/Terminal:

    • On Windows: Open File Explorer, go to the folder where you saved my_calculator.py. Click in the address bar at the top, type cmd, and press Enter. This will open Command Prompt directly in that folder.
    • On Mac/Linux: Open your Terminal application and use the cd command to navigate to the directory where you saved the file. For example: cd ~/Desktop or cd /path/to/your/folder.
  3. Run the Python script:

    • Once you are in the correct folder in your Command Prompt/Terminal, type the following command and press Enter:
      python my_calculator.py
  4. Interact with the calculator:

    • Follow the on-screen prompts to enter your numbers and choose an operation.
    • The calculator will perform the calculation and display the result, then the program will exit.

🀝 Contributing

This project is a basic learning exercise. Feel free to fork it, experiment with the code, and make improvements!

πŸ“„ License

This project is open-source and available under the MIT License.


About

basic addition

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages