Skip to main content

A simple calculator built in Python

Project description

Calculator

A simple Python calculator package that provides basic arithmetic operations such as addition, subtraction, multiplication, division, and power.

This package can be used both as a Python library and as a command-line tool.


Features

  • Addition of multiple numbers
  • Subtraction of two numbers
  • Multiplication of multiple numbers
  • Division
  • Power calculation
  • Simple and lightweight Python package

Installation

Install the package using pip:

pip install lakshaycalculator

Or install locally:

pip install .

Usage (Python)

You can import the functions directly in Python.

from lakshayCalculator.calculator import add, subtract, multiply, division, power

print(add(1,2,3,4))
print(subtract(10,5))
print(multiply(2,3,4))
print(division(10,2))
print(power(2,3))

Output

10
5
24
5.0
8

Usage (CLI)

After installation, you can run the calculator from the terminal:

calculator

This command runs the main() function defined in the package.


Available Functions

add

Adds multiple numbers.

add(1,2,3)

subtract

Subtracts two numbers.

subtract(10,5)

multiply

Multiplies multiple numbers.

multiply(2,3,4)

division

Divides two numbers.

division(10,2)

power

Calculates power of a number.

power(2,3)

Requirements

  • Python 3.8 or higher

Author

Lakshya Varshney Email: lakshyavarshney62@gmail.com


License

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

lakshaycalculator-0.1.1.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

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

lakshaycalculator-0.1.1-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lakshaycalculator-0.1.1.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for lakshaycalculator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d94cd235fc79b09db32e1643cfc2e22e8ac38f6193dde5010bfdad086f5eccf9
MD5 9cbed34e0289c9b7bf1e928b9eaa74b1
BLAKE2b-256 b4a690a56d68717699c17f72d8b31c9c2e5d88e79d74ca15f74aeb2a59f7dd25

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lakshaycalculator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fbfd47919b39c6496b8ceb88f0cdf221fd8447bc65d1360f22a6158e04991d8f
MD5 9e9ba99019ddf42fadbf27edceb96b8f
BLAKE2b-256 bb76d545598111ba0437e70a4b9542c475e2036899e65d81269cb2a3b44456b5

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