Task: Implement a Python module for molecular mass calculation
Location: Create and implement the module at /app/molecool.py (the implementation goes in /app/molecool.py). It may also be structured as a package under /app/molecool/ if you prefer, but the tests will import as a top-level module named molecool.
Required functionality:
Provide a function with the exact signature:
def calculate_molecular_mass(symbols: list[str]) -> float
Behavior:
symbols is a list of element symbol strings (e.g., ['C', 'H', 'H', 'H', 'H']).
Compute the molecular mass by summing the standard atomic masses for each symbol in the list.
Use a defined internal mapping of atomic masses (at least for H and C, but ideally for common elements). Examples:
{'H': 1.008, 'C': 12.01, 'N': 14.01, 'O': 16.00, 'S': 32.06, ...}
The function should return a float representing the total mass.
If an unknown element symbol is encountered, raise a clear ValueError with a message like "Unknown element symbol: {symbol}".
Example: calculate_molecular_mass(['C','H','H','H','H']) should return approximately 16.04 (C: 12.01 + 4*1.008 = 16.042).
Implementation details:
Include a module-level dictionary (e.g., ATOMIC_MASSES) for element masses used by the function.
The function should be pure (no I/O, no side effects) and deterministic.
Include type hints, a concise docstring for the function, and a brief module docstring.
Expose the public API via all = ['calculate_molecular_mass'].
Optionally include a minimal version = "0.1.0" if desired.
Tests compatibility:
The provided test creates symbols = ['C', 'H', 'H', 'H', 'H'], calls molecool.calculate_molecular_mass(symbols), and asserts the result is approximately 16.04 with a tolerance of 0.01. Ensure the implementation passes this test import and usage pattern.
Deliverables:
A single Python file at /app/molecool.py containing the described function and supporting data structures.