>>> pressure_of_gas_system(2, 100, 5) 332.57848 >>> pressure_of_gas_system(0.5, 273, 0.004) 283731.01575 >>> pressure_of_gas_system(3, -0.46, 23.5) Traceback (most recent call last): ... ValueError: Invalid inputs. Enter positive value.
(moles: float, kelvin: float, volume: float)
| 22 | |
| 23 | |
| 24 | def pressure_of_gas_system(moles: float, kelvin: float, volume: float) -> float: |
| 25 | """ |
| 26 | >>> pressure_of_gas_system(2, 100, 5) |
| 27 | 332.57848 |
| 28 | >>> pressure_of_gas_system(0.5, 273, 0.004) |
| 29 | 283731.01575 |
| 30 | >>> pressure_of_gas_system(3, -0.46, 23.5) |
| 31 | Traceback (most recent call last): |
| 32 | ... |
| 33 | ValueError: Invalid inputs. Enter positive value. |
| 34 | """ |
| 35 | if moles < 0 or kelvin < 0 or volume < 0: |
| 36 | raise ValueError("Invalid inputs. Enter positive value.") |
| 37 | return moles * kelvin * UNIVERSAL_GAS_CONSTANT / volume |
| 38 | |
| 39 | |
| 40 | def volume_of_gas_system(moles: float, kelvin: float, pressure: float) -> float: |
nothing calls this directly
no outgoing calls
no test coverage detected