MCPcopy Create free account
hub / github.com/dabeaz-course/practical-python / tabulate_shares

Method tabulate_shares

Solutions/8_2/portfolio.py:42–47  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

40 return sum(s.shares * s.price for s in self._holdings)
41
42 def tabulate_shares(self):
43 from collections import Counter
44 total_shares = Counter()
45 for s in self._holdings:
46 total_shares[s.name] += s.shares
47 return total_shares
48
49
50

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected