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

Method tabulate_shares

Solutions/6_3/portfolio.py:23–28  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

21 return sum([s.shares * s.price for s in self._holdings])
22
23 def tabulate_shares(self):
24 from collections import Counter
25 total_shares = Counter()
26 for s in self._holdings:
27 total_shares[s.name] += s.shares
28 return total_shares
29
30
31

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected