Task Description: Implement a Simple Calculator Functionality
You are required to implement a simple calculator within a function named calculate located in the /app/ directory. This function should process basic mathematical operations.
Functionality Requirements:
The calculate function should accept three parameters:
num1 (a float): the first operand.
num2 (a float): the second operand.
operation (a string): the arithmetic operation to be performed. The accepted operations are:
"add" for addition
"subtract" for subtraction
"multiply" for multiplication
"divide" for division
The function should return the result of the operation:
If operation is "add", return num1 + num2
If operation is "subtract", return num1 - num2
If operation is "multiply", return num1 * num2
If operation is "divide":
If num2 is zero, return None (to indicate division by zero is not allowed)
Otherwise, return num1 / num2
If the operation parameter does not match any of the accepted operations, return None.
Implementation Path:
The completed code must be placed under /app/calculate.py.
Ensure that the implementation meets all the specified requirements, as the provided tests are designed to validate these functionalities.