-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.py
More file actions
44 lines (34 loc) · 963 Bytes
/
Copy pathutil.py
File metadata and controls
44 lines (34 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import re
import random
def Get_Inches(height):
r = re.compile(r"([0-9]+)[-']([0-9]+)")
m = r.match(height)
if m == None:
return float("NaN")
else:
return int(m.group(1)) * 12 + float(m.group(2))
def neutralInput():
while True:
Neutral = input("Neutral court? (yes/no): ")
if Neutral not in ("yes", "no", "y", "n"):
print("Not an appropriate choice.")
else:
return Neutral
def GetNeutralValue(num):
if num == 1 or num == "1":
return "y"
return "n"
def GetBooleanValue(str_value):
if str_value == 1 or str_value == "1":
return True
return False
def GetInjurySeverity(name):
severity_rating = random.random()
if severity_rating < 0.7:
return "Mild"
elif (severity_rating < 0.9 and name != "Knee") or (
severity_rating < 0.98 and name == "Knee"
):
return "Moderate"
else:
return "Severe"