MCPcopy Index your code
hub / github.com/injetlee/Python / generate_iso_code

Function generate_iso_code

countPm.py:11–18  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

9 return result
10
11def generate_iso_code(x):
12 pm_value = [0.01,0.02,0.04,0.08,0.16,0.32,0.64,1.3,2.5,5,10,20,40,80] #颗粒浓度
13 iso = list(range(1,25)) #iso级别,共24级
14 for i in range(len(pm_value)): #for循环得到某个浓度范围的iso4006级别
15 if pm_value[i] < x <= pm_value[i+1]:
16 iso_code = iso[i]
17 break
18 return iso_code
19
20if __name__ == '__main__':
21 count_pm(7.95,5.85,3.98)

Callers 1

count_pmFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected