File tree 1 file changed +24
-1
lines changed
1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change 17
17
from math import pow , sqrt
18
18
19
19
20
- def validate (* values ) -> bool :
20
+ def validate (* values : float ) -> bool :
21
+ """
22
+ Input Parameters:
23
+ -----------------
24
+ effusion_rate_1: Effustion rate of first gas (m^2/s, mm^2/s, etc.)
25
+ effusion_rate_2: Effustion rate of second gas (m^2/s, mm^2/s, etc.)
26
+ molar_mass_1: Molar mass of the first gas (g/mol, kg/kmol, etc.)
27
+ molar_mass_2: Molar mass of the second gas (g/mol, kg/kmol, etc.)
28
+
29
+ Returns:
30
+ --------
31
+ >>> validate(2.016, 4.002)
32
+ True
33
+ >>> validate(-2.016, 4.002)
34
+ Traceback (most recent call last):
35
+ ...
36
+ ValueError: Invalid inputs. Effusion rates and molar masses must be a positive
37
+ value.
38
+ >>> validate()
39
+ False
40
+ """
21
41
for value in values :
22
42
if value >= 0.0 :
23
43
return True
@@ -189,3 +209,6 @@ def second_molar_mass(
189
209
"""
190
210
validate (molar_mass , effusion_rate_1 , effusion_rate_2 )
191
211
return round (pow (effusion_rate_1 / effusion_rate_2 , 2 ) / molar_mass , 6 )
212
+
213
+
214
+ print (validate ())
You can’t perform that action at this time.
0 commit comments