Skip to main content

A simple calculator package

Project description

Calculator Prueba

This project contains a simple arithmetic module that performs basic mathematical operations.

Arithmetic Module

The arithmetic module provides a class Arithmetic that can perform the following operations:

  • Addition
  • Subtraction
  • Multiplication
  • Division

Usage

To use the Arithmetic class, you need to create an instance of the class with two numbers and then call the desired method.

from calculator_prueba.arithmetic import Arithmetic

# Create an instance of Arithmetic
calc = Arithmetic(10, 5)

# Perform operations
print(calc.add())       # Output: 15
print(calc.subtract())  # Output: 5
print(calc.multiply())  # Output: 50
print(calc.divide())    # Output: 2.0

Division by Zero

The divide method raises a ValueError if an attempt is made to divide by zero.

calc = Arithmetic(10, 0)
calc.divide()  # Raises ValueError: Cannot divide by zero

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

calculator2004-0.1.0.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

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

calculator2004-0.1.0-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file calculator2004-0.1.0.tar.gz.

File metadata

  • Download URL: calculator2004-0.1.0.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for calculator2004-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d6f8fcd28b2ccedb0b9e3f6ed5ca82be92e22cfb8bb5225bb2f6d9e195216202
MD5 79aceb192ad428cef6cbe78d5cbf67be
BLAKE2b-256 fd5d5977f776e1c94ce2d2b256a6d70f9d5179ab12cb6d982e8a6caa3eeb5e1e

See more details on using hashes here.

File details

Details for the file calculator2004-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: calculator2004-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for calculator2004-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c87bb913e0d3c9be99ab0a33ed78aa9abce20dca5174d0aaf09ae0d59c78f62b
MD5 e62faed5c20e0cbf8e0ba415d1b05dea
BLAKE2b-256 02e6230c845468a2ecfea5fb57afd98e09f4332343c1b69f8da03e53c8d3ab43

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