-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtemps.py
More file actions
33 lines (24 loc) · 725 Bytes
/
temps.py
File metadata and controls
33 lines (24 loc) · 725 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
NORMAL_LOW = 97 # normal human body temp lower end
NORMAL_HIGH = 99 # normal human body temp higher end
def sort_temperatures(measurements):
low = []
normal = []
high = []
for temperature in measurements:
if temperature < NORMAL_LOW:
low.append(temperature)
elif temperature > NORMAL_HIGH:
high.append(temperature)
else:
normal.append(temperature)
return low, normal, high
def convert_from_fahrenheit(temps):
results = []
for temp in temps:
results.append((temp-32)/1.8)
return results
def convert_to_fahrenheit(temps):
results = []
for temp in temps:
results.append(temp*1.8+32)
return results