>>> moles_of_gas_system(100, 5, 10) 0.06013618199229246 >>> moles_of_gas_system(110, 5009, 1000) 5476.766101807144 >>> moles_of_gas_system(3, -0.46, 23.5) Traceback (most recent call last): ... ValueError: Invalid inputs. Enter positive value.
(kelvin: float, volume: float, pressure: float)
| 71 | |
| 72 | |
| 73 | def moles_of_gas_system(kelvin: float, volume: float, pressure: float) -> float: |
| 74 | """ |
| 75 | >>> moles_of_gas_system(100, 5, 10) |
| 76 | 0.06013618199229246 |
| 77 | >>> moles_of_gas_system(110, 5009, 1000) |
| 78 | 5476.766101807144 |
| 79 | >>> moles_of_gas_system(3, -0.46, 23.5) |
| 80 | Traceback (most recent call last): |
| 81 | ... |
| 82 | ValueError: Invalid inputs. Enter positive value. |
| 83 | """ |
| 84 | if kelvin < 0 or volume < 0 or pressure < 0: |
| 85 | raise ValueError("Invalid inputs. Enter positive value.") |
| 86 | |
| 87 | return pressure * volume / (kelvin * UNIVERSAL_GAS_CONSTANT) |
| 88 | |
| 89 | |
| 90 | if __name__ == "__main__": |
nothing calls this directly
no outgoing calls
no test coverage detected