calculator-linpel-calc


Namecalculator-linpel-calc JSON
Version 0.1.4 PyPI version JSON
download
home_page
SummaryBasic Python Calculator
upload_time2023-12-20 23:54:04
maintainer
docs_urlNone
authorLinas Peleckas
requires_python
license
keywords python calculations
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            

# Basic Calculator

A basic Python class for arithmetic calculations. `Calculator` performs simple arithmetic calculations:
- Addition / Subtraction
- Multiplication / Division
- Take (n) root of a number.

## Installation
You can incorporate the Calculator class into your Python project by importing it :

## Installation

You can incorporate the `Calculator` class into your Python project by importing it :

```bash
  pip install calculator_linpel_calc
```
    
## Usage/Examples
### Setting up a calculator
To set up `Calculator` calss by importing `Calculator` from `calculator_linpel_calc` and creating an instance.
```python
from Calculator.Calculator import Calculator

# Creata an instance of the Calculator
calculator = Calculator()
```
### Executing Calculator operations
The `Calculator` class able is able to perform calculations:
- `Addition(*arg: float)`: Sum numbers.
- `Subtraction(*arg: float)`: Subtract numbers.
- `Multiplication(*arg: float)`: Multiply numbers together.
- `Division(*arg: float)`: Divide numbers.
- `Root(nth_root: float, number: float)`: Take nth root of number.
Example of Usage
```python
calculator = Calculator()

calculator.Addition(1, 2, 3)    # Adds 1, 2, 3, result: 6.0
calculator.Subtraction(1, 2, 3) # Subracts 1, 2, 3 from self.memory = 0, result: -6.0
calculator.Multiplication(7, 3) # Multiplies 7 by 3, result: 21.0
calculator.Division(9, 3)       # Divides 9 by 3, result: 3.0
calculator.Root(2, 9)           # Takes n-th root (2) of 9, result: 3.0
```
### Error Handling
The `Calculator` class raises a `ZeroDivisionError` when attempting to divide by zero, or 0 root calculations.
### License
This code is released under the [MIT License](https://opensource.org/license/mit/)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "calculator-linpel-calc",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python,calculations",
    "author": "Linas Peleckas",
    "author_email": "<peleckas.l@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/22/cc/25559af63146ea1680c07050b9ae166ade9bd7f30191f71519a0fc2f8a96/calculator_linpel_calc-0.1.4.tar.gz",
    "platform": null,
    "description": "\r\n\r\n# Basic Calculator\r\n\r\nA basic Python class for arithmetic calculations. `Calculator` performs simple arithmetic calculations:\r\n- Addition / Subtraction\r\n- Multiplication / Division\r\n- Take (n) root of a number.\r\n\r\n## Installation\r\nYou can incorporate the Calculator class into your Python project by importing it :\r\n\r\n## Installation\r\n\r\nYou can incorporate the `Calculator` class into your Python project by importing it :\r\n\r\n```bash\r\n  pip install calculator_linpel_calc\r\n```\r\n    \r\n## Usage/Examples\r\n### Setting up a calculator\r\nTo set up `Calculator` calss by importing `Calculator` from `calculator_linpel_calc` and creating an instance.\r\n```python\r\nfrom Calculator.Calculator import Calculator\r\n\r\n# Creata an instance of the Calculator\r\ncalculator = Calculator()\r\n```\r\n### Executing Calculator operations\r\nThe `Calculator` class able is able to perform calculations:\r\n- `Addition(*arg: float)`: Sum numbers.\r\n- `Subtraction(*arg: float)`: Subtract numbers.\r\n- `Multiplication(*arg: float)`: Multiply numbers together.\r\n- `Division(*arg: float)`: Divide numbers.\r\n- `Root(nth_root: float, number: float)`: Take nth root of number.\r\nExample of Usage\r\n```python\r\ncalculator = Calculator()\r\n\r\ncalculator.Addition(1, 2, 3)    # Adds 1, 2, 3, result: 6.0\r\ncalculator.Subtraction(1, 2, 3) # Subracts 1, 2, 3 from self.memory = 0, result: -6.0\r\ncalculator.Multiplication(7, 3) # Multiplies 7 by 3, result: 21.0\r\ncalculator.Division(9, 3)       # Divides 9 by 3, result: 3.0\r\ncalculator.Root(2, 9)           # Takes n-th root (2) of 9, result: 3.0\r\n```\r\n### Error Handling\r\nThe `Calculator` class raises a `ZeroDivisionError` when attempting to divide by zero, or 0 root calculations.\r\n### License\r\nThis code is released under the [MIT License](https://opensource.org/license/mit/)\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Basic Python Calculator",
    "version": "0.1.4",
    "project_urls": null,
    "split_keywords": [
        "python",
        "calculations"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e175da827bd87adbd5938576aac026760579703644ec8ba6103cf263e27d3765",
                "md5": "4b687760af28dccbacb08e8a45abeb10",
                "sha256": "32b6a39fe9d8bcba56e56bff3384185fc5a813c596a8bf1caf2bdec9d7417f9f"
            },
            "downloads": -1,
            "filename": "calculator_linpel_calc-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4b687760af28dccbacb08e8a45abeb10",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4070,
            "upload_time": "2023-12-20T23:54:02",
            "upload_time_iso_8601": "2023-12-20T23:54:02.016169Z",
            "url": "https://files.pythonhosted.org/packages/e1/75/da827bd87adbd5938576aac026760579703644ec8ba6103cf263e27d3765/calculator_linpel_calc-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "22cc25559af63146ea1680c07050b9ae166ade9bd7f30191f71519a0fc2f8a96",
                "md5": "75695a636c6fe6fe43bf7ebfd5f0026c",
                "sha256": "429e636a571dd0f0ab5695dafb3c95109b57a3ac663beafb168e2335f8b49ad9"
            },
            "downloads": -1,
            "filename": "calculator_linpel_calc-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "75695a636c6fe6fe43bf7ebfd5f0026c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4281,
            "upload_time": "2023-12-20T23:54:04",
            "upload_time_iso_8601": "2023-12-20T23:54:04.289937Z",
            "url": "https://files.pythonhosted.org/packages/22/cc/25559af63146ea1680c07050b9ae166ade9bd7f30191f71519a0fc2f8a96/calculator_linpel_calc-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-20 23:54:04",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "calculator-linpel-calc"
}
        
Elapsed time: 0.16216s