# Basic Calculator
A basic Python class for arithmetic calculations. `Calculator` performs simple arithmetic calculations:
- Addition / Subtraction
- Multiplication / Division
- Take (n) root of a number.
More details regardin package at: https://pypi.org/project/BasicCalculatorLinasPelVersion/
## 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 BasicCalculatorLinasPelVersion
```
## Usage/Examples
### Setting up a calculator
To set up `Calculator` calss by importing `Calculator` from `BasicCalculatorLinasPelVersion` and creating an instance.
```python
from BasicCalculatorLinasPelVersion 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
```
### Controlling
The `Calculator` class allows you to continuously execute calcualtions. To start over reset `self.memory` with `calculator.reset_memory()`
### 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-Lin-Pel",
"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/a3/20/ede866bf79ba6a6bdacbe04aa72ebbd622335f6d568f6f73a8493f2cafd2/Calculator_Lin_Pel-0.1.3.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\nMore details regardin package at: https://pypi.org/project/BasicCalculatorLinasPelVersion/\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 BasicCalculatorLinasPelVersion\r\n```\r\n \r\n## Usage/Examples\r\n### Setting up a calculator\r\nTo set up `Calculator` calss by importing `Calculator` from `BasicCalculatorLinasPelVersion` and creating an instance.\r\n```python\r\nfrom BasicCalculatorLinasPelVersion 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### Controlling\r\nThe `Calculator` class allows you to continuously execute calcualtions. To start over reset `self.memory` with `calculator.reset_memory()`\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 Calculator",
"version": "0.1.3",
"project_urls": null,
"split_keywords": [
"python",
"calculations"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1c2f860180529461d2ccd3ff7c23098907c8f9dd9b8ded54a53a7f4e22ca4236",
"md5": "5c337e97cb36c041f26ea886e5bde1da",
"sha256": "ea3e87c506794e7c13e33228eee3848ba2debebd1d4a5adf748c27adf839728b"
},
"downloads": -1,
"filename": "Calculator_Lin_Pel-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5c337e97cb36c041f26ea886e5bde1da",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 4785,
"upload_time": "2023-12-20T20:21:18",
"upload_time_iso_8601": "2023-12-20T20:21:18.525294Z",
"url": "https://files.pythonhosted.org/packages/1c/2f/860180529461d2ccd3ff7c23098907c8f9dd9b8ded54a53a7f4e22ca4236/Calculator_Lin_Pel-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a320ede866bf79ba6a6bdacbe04aa72ebbd622335f6d568f6f73a8493f2cafd2",
"md5": "def049419149eb57147dca7d71151e0b",
"sha256": "4dfb67c7ce45685d4e52d16ac5083d92b4b04e02cb5dbc0a0984d60a4e3bb48e"
},
"downloads": -1,
"filename": "Calculator_Lin_Pel-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "def049419149eb57147dca7d71151e0b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4827,
"upload_time": "2023-12-20T20:21:19",
"upload_time_iso_8601": "2023-12-20T20:21:19.538235Z",
"url": "https://files.pythonhosted.org/packages/a3/20/ede866bf79ba6a6bdacbe04aa72ebbd622335f6d568f6f73a8493f2cafd2/Calculator_Lin_Pel-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-20 20:21:19",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "calculator-lin-pel"
}