-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexercice1.txt
More file actions
47 lines (47 loc) · 1.21 KB
/
exercice1.txt
File metadata and controls
47 lines (47 loc) · 1.21 KB
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
45
46
47
def main(path):
d = {
'i': 0,
'p': {
'TERRA': {
'i': 1,
'p': {
'1999': {
'i': 2,
'p': {
'1976': 0,
'2015': 1,
'1990': 2,
}
},
'2011': 3,
'2001': {
'i': 3,
'p': {
'POD': 4,
'SMT': 5,
'MASK': 6,
}
},
}
},
'GAMS': {
'i': 1,
'p': {
'1999': {
'i': 2,
'p': {
'1976': 7,
'2015': 8,
'1990': 9,
}
},
'2011': 10,
'2001': 11,
}
},
}
}
r = d
while type(r) is not int:
r = r['p'][str(path[r['i']])]
return r