-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.py
More file actions
24 lines (23 loc) · 707 Bytes
/
Copy pathTest.py
File metadata and controls
24 lines (23 loc) · 707 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
class Test:
@staticmethod
def main():
num_list = [(151258350, 2464),
(151258350, 56),
(151262958, 56),
(151258350, 56),
(151262958, 112),
(151262958, 112),
(151259627, 56),
(151262958, 112),
(151262958, 56)]
num_dict = {}
for t in num_list:
if t[0] in num_dict:
print(t[0])
num_dict[t[0]] = num_dict[t[0]] + t[1]
else:
num_dict[t[0]] = t[1]
#
# for key, value in num_dict.items():
# print (key, value)
Test.main()