You need to create a simple calculator that supports basic arithmetic operations: addition, subtraction, multiplication, and division. The calculator should include methods for each operation and should handle both integer and floating-point numbers.
Requirements:
Create a class named Calculator in the /app/ directory.
Implement the following methods in the Calculator class:
add(a, b): Returns the sum of a and b.
subtract(a, b): Returns the difference when b is subtracted from a.
multiply(a, b): Returns the product of a and b.
divide(a, b): Returns the quotient when a is divided by b. The method should raise a ValueError if b is zero to prevent division by zero.
Ensure that methods can handle both integers and floats seamlessly.
Each method should have appropriate docstrings explaining its functionality.
Follow these requirements to implement the Calculator class so that all provided test cases in the test code can pass successfully.