Мальчевский Степан Алексеевич, 321 группа DefCounter 12276
Андреева Елизавета, 522 DefCounter 12384
f1from collections import Counterf1from collections import Counter
22
3class DefCounter(Counter):3class DefCounter(Counter):
44
n5    def __init__(self, iterable=None, /, missing=-1):n5    def __init__(self, iterable=None, missing=-1):
6        super().__init__(iterable)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        summ = 0t13        s = 0
14        for value in self.values():14        for i in self.values():
15            if value > 0:15            if i > 0:
16                summ += value16                s += i
17        return summ17        return s
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op