class Calculator:
"""
A simple calculator class.
Attributes:
name (str): The name of the calculator.
Methods:
add(a, b): Add two numbers.
subtract(a, b): Subtract one number from another.
multiply(a, b): Multiply two numbers.
divide(a, b): Divide one number by another.
"""
def __init__(self, name):
"""
Initialize the calculator object.
Args:
name (str): The name of the calculator.
"""
self.name = name
def add(self, a, b):
"""
Add two numbers.
Args:
a (int or float): The first number.
b (int or float): The second number.
Returns:
The sum of the two numbers.
"""
return a + b
def subtract(self, a, b):
"""
Subtract one number from another.
Args:
a (int or float): The number to subtract from.
b (int or float): The number to subtract.
Returns:
The difference between the two numbers.
"""
return a - b
def multiply(self, a, b):
"""
Multiply two numbers.
Args:
a (int or float): The first number.
b (int or float): The second number.
Returns:
The product of the two numbers.
"""
return a * b
def divide(self, a, b):
"""
Divide one number by another.
Args:
a (int or float): The number to divide.
b (int or float): The number to divide by.
Returns:
The quotient of the two numbers.
"""
if b == 0:
raise ValueError("Division by zero is not allowed.")
return a / b