mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 10:28:39 +00:00
Compare commits
No commits in common. "5ce54f21805afea7add57a1541016a13b264bda8" and "9f684576bb3a66fb9fafed0ce921e5bd4395decb" have entirely different histories.
5ce54f2180
...
9f684576bb
@ -57,7 +57,7 @@ def temperature_of_gas_system(moles: float, volume: float, pressure: float) -> f
|
||||
"""
|
||||
>>> temperature_of_gas_system(2, 100, 5)
|
||||
30.068090996146232
|
||||
>>> temperature_of_gas_system(11, 5009, 1000)
|
||||
>>> temperature_of_gas_system(11,5009,1000)
|
||||
54767.66101807144
|
||||
>>> temperature_of_gas_system(3, -0.46, 23.5)
|
||||
Traceback (most recent call last):
|
||||
@ -67,16 +67,16 @@ def temperature_of_gas_system(moles: float, volume: float, pressure: float) -> f
|
||||
if moles < 0 or volume < 0 or pressure < 0:
|
||||
raise ValueError("Invalid inputs. Enter positive value.")
|
||||
|
||||
return pressure * volume / (moles * UNIVERSAL_GAS_CONSTANT)
|
||||
return (pressure * volume) / (moles * UNIVERSAL_GAS_CONSTANT)
|
||||
|
||||
|
||||
def moles_of_gas_system(kelvin: float, volume: float, pressure: float) -> float:
|
||||
def num_moles_of_gas_in_system(kelvin: float, volume: float, pressure: float) -> float:
|
||||
"""
|
||||
>>> moles_of_gas_system(100, 5, 10)
|
||||
>>> temperature_of_gas_system(100, 5, 10)
|
||||
0.06013618199229246
|
||||
>>> moles_of_gas_system(110,5009,1000)
|
||||
>>> temperature_of_gas_system(110,5009,1000)
|
||||
5476.766101807144
|
||||
>>> moles_of_gas_system(3, -0.46, 23.5)
|
||||
>>> temperature_of_gas_system(3, -0.46, 23.5)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
ValueError: Invalid inputs. Enter positive value.
|
||||
@ -84,7 +84,7 @@ def moles_of_gas_system(kelvin: float, volume: float, pressure: float) -> float:
|
||||
if kelvin < 0 or volume < 0 or pressure < 0:
|
||||
raise ValueError("Invalid inputs. Enter positive value.")
|
||||
|
||||
return pressure * volume / (kelvin * UNIVERSAL_GAS_CONSTANT)
|
||||
return (pressure * volume) / (kelvin * UNIVERSAL_GAS_CONSTANT)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Loading…
x
Reference in New Issue
Block a user