Skip to content

ElderNuel/Python-Week-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Basic Calculator Program

Description

A simple Python calculator that performs basic arithmetic operations (addition, subtraction, multiplication, and division) on two user-input numbers.

Features

  • Takes two numbers as input
  • Supports four operations: +, -, *, /
  • Handles division by zero error
  • Provides clear output showing the operation and result
  • User-friendly prompts

Requirements

  • Python 3.x

Installation

No installation required. Just run the Python script directly.

Usage

  1. Run the program:
    python calculator.py
  2. Follow the on-screen prompts:
    • Enter the first number
    • Enter the second number
    • Choose an operation (+, -, *, /)

Example

$ python calculator.py
Enter the first number: 10
Enter the second number: 5
Enter the operation (+, -, *, /): +
10.0 + 5.0 = 15.0

Error Handling

  • Displays error for invalid operations (anything other than +, -, *, /)
  • Prevents division by zero with appropriate error message

License

This project is open source and free to use.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

Contact

For questions or feedback, please open an issue in the repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages