Skip to main content

Just a simple calculator class that has basic functionality of calculator

Project description

SimpleCalculator

SimpleCalculator is a basic Python class for performing arithmetic operations. It supports addition, subtraction, multiplication, division, modulus, and floor division. You can also check equality between two numbers.

Features

  • Add two numbers
  • Subtract two numbers
  • Multiply two numbers
  • Divide two numbers
  • Modulus of two numbers
  • Floor division of two numbers
  • Check if two numbers are equal
  • Retrieve the last calculated result

Installation

You can install this package from PyPI (once uploaded) using pip:

pip install simplecalculatoruniue

Usage

from simplecalculator import SimpleCalculator

Create an instance of the calculator

calc = SimpleCalculator()

Perform operations

add_result = calc.add(5, 3) # 8 sub_result = calc.sub(10, 4) # 6 mul_result = calc.mul(7, 2) # 14 div_result = calc.div(15, 3) # 5.0 mod_result = calc.mod(10, 3) # 1 floor_result = calc.floor(10, 3) # 3 equal_result = calc.equal(5, 5) # True

Get the last result

last_result = calc.get_result() # Returns the result of the last operation

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simple_cal_1-0.1.0.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simple_cal_1-0.1.0-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file simple_cal_1-0.1.0.tar.gz.

File metadata

  • Download URL: simple_cal_1-0.1.0.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.3

File hashes

Hashes for simple_cal_1-0.1.0.tar.gz
Algorithm Hash digest
SHA256 96e52e79ca610dbc99d2dcf2c27dea23bd928927ba3b96eedfeef540fd15e3f9
MD5 2310d0206c6bc7a260e47fc8c0587982
BLAKE2b-256 b92dbafed00ce35cb1dd1c8f213fe83429a3f2887d10a3e83d9f991cdedabd83

See more details on using hashes here.

File details

Details for the file simple_cal_1-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: simple_cal_1-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.3

File hashes

Hashes for simple_cal_1-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f39ccb5946d04b2f28d4b73064a466c5124ecbceb21d93b639304b1983cf7754
MD5 9b585ded605fbd73745226dc7e3dbac3
BLAKE2b-256 e9c26a55eb7101d113d5f7a7994628aa4249c0d4a070591a2710b1dc71e9e2d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page