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

Uploaded Python 3

File details

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

File metadata

  • Download URL: lakshaycalculator-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 647ae8db6e413f2f9d205ca03276bc85a83dc26c8c61d7bb6c2a03fa0e29a08e
MD5 8056b511f946f246c40a7a3fe94a9e6e
BLAKE2b-256 d488cb0c29122786d0031dc8288d7d73d9f4ac91ac7c681c9e60939ff4d14cf3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lakshaycalculator-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0a2e26782e8be5b2befd6f3cea231cb12f36ca03fff035f665dd4b61322246c7
MD5 9d4f20602c29270f0a97fafd74ddeb53
BLAKE2b-256 c56042bc723e90df31600a8d13cec3e25eae82ca8f6d051def0f02dc84a5c7f1

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