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.1.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.1-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simple_cal_1-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 6817bf474ffd1950d58c141fc959524f7c83d1206880f857739f56891bbca11f
MD5 13b856d7b6a80bf8a37092024c1b4568
BLAKE2b-256 7322b7ff48d558d6c7c176ea9147fe7a2ccec6bdba4140c55aaabbfd5390dc6e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: simple_cal_1-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 158fdc6e781608dcb407e9014278570c4455f9d12faac5034d5e6bed0b85ca86
MD5 69aced0f0cdaeaf83e6e038abce90a88
BLAKE2b-256 96c3f8565e002f64e332a4c66c3e9a1f61cea6f7a756af3af86f9cd3a3189a98

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