Guest User

Untitled

a guest
Oct 22nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. 1294919 : (Person(1294919, 'Russel', 97.00, 1.90, 24, 0), 31022)
  2.  
  3. 1294919 : Person(1294919, 'Russel', 97.00, 1.90, 24, 31022)
  4.  
  5. {1665845: Person(1665845, 'Rurick', 101.00, 1.98, 75, 0), 1294919: Person(1294919, 'Russel', 97.00, 1.90, 24, 0)}
  6.  
  7. lines = [['1665845', '2001-01-06', '28,448,615,27,705'], ['1665845', '2001-01-10', '218,37,356,621,466,319,147,774,231,167,399,150,417,34,3'], ['1294919', '2001-01-04', '639,118,328,413,222,491,738,389,11,372,183,650,281,643,26,398,685,171'], ['1294919', '2001-01-10', '314,611,485,208,515,240,586,511,713,58,28,392,140,529,353,489,375,412,596'], ['1665845', '2001-01-04', '670,665,681,184,22,752,390,523,507,171,467,19,296,720,58,230,721,686'], ['1665845', '2001-01-02', '432,210,732,204,771,555,448,82,343'], ['1294919', '2001-01-06', '113,225,564,554,392,544,313'], ['1294919', '2001-01-05', '437,219,239,545,588,303,477,384,87,254,429,635,188,372,572,712,383'], ['1294919', '2001-01-03', '771,373'], ['1294919', '2001-01-08', '650,679,492,524,202,689,224,268,195,455,400,235,518,505']]
  8.  
  9. from collections import defaultdict
  10. d_dict = defaultdict(int)
  11. for k,_, v in lines:
  12. d_dict[int(k)]+=sum(int(i) for i in v.split(','))
  13.  
  14. for k in people:
  15.  
  16.  
  17. people[k] = people[k], d_dict[k]
Add Comment
Please, Sign In to add comment