Казимагамедов Тагир 424 DefCounter 11867
Почернина Ольга, 528 группа DefCounter 12535
f1from collections import Counterf1from collections import Counter
22
3class DefCounter(Counter):3class DefCounter(Counter):
44
n5    def __init__(self, obj, missing=-1):n5    def __init__(self, iterable, missing=-1):
6        super().__init__(obj)6        super().__init__(iterable)
7        self.missing = missing7        self.missing = missing
88
9    def __missing__(self, key):9    def __missing__(self, key):
10        return self.missing10        return self.missing
1111
12    def __abs__(self):12    def __abs__(self):
t13        res = 0t13        summ = 0
14        for val in self.values():14        for value in self.values():
15            if val > 0:15            if value > 0:
16                res += val16                summ += value
17        return res17        return summ
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op