>>> volume_of_gas_system(2, 100, 5) 332.57848 >>> volume_of_gas_system(0.5, 273, 0.004) 283731.01575 >>> volume_of_gas_system(3, -0.46, 23.5) Traceback (most recent call last): ... ValueError: Invalid inputs. Enter positive value.
(moles: float, kelvin: float, pressure: float)
| 38 | |
| 39 | |
| 40 | def volume_of_gas_system(moles: float, kelvin: float, pressure: float) -> float: |
| 41 | """ |
| 42 | >>> volume_of_gas_system(2, 100, 5) |
| 43 | 332.57848 |
| 44 | >>> volume_of_gas_system(0.5, 273, 0.004) |
| 45 | 283731.01575 |
| 46 | >>> volume_of_gas_system(3, -0.46, 23.5) |
| 47 | Traceback (most recent call last): |
| 48 | ... |
| 49 | ValueError: Invalid inputs. Enter positive value. |
| 50 | """ |
| 51 | if moles < 0 or kelvin < 0 or pressure < 0: |
| 52 | raise ValueError("Invalid inputs. Enter positive value.") |
| 53 | return moles * kelvin * UNIVERSAL_GAS_CONSTANT / pressure |
| 54 | |
| 55 | |
| 56 | def temperature_of_gas_system(moles: float, volume: float, pressure: float) -> float: |
nothing calls this directly
no outgoing calls
no test coverage detected