We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3b86444 commit fc0cbefCopy full SHA for fc0cbef
physics/grahams_law.py
@@ -17,7 +17,27 @@
17
from math import pow, sqrt
18
19
20
-def validate(*values) -> bool:
+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
41
for value in values:
42
if value >= 0.0:
43
return True
0 commit comments