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

Method cost

Solutions/4_4/stock.py:12–16  ·  view source on GitHub ↗

Return the cost as shares*price

(self)

Source from the content-addressed store, hash-verified

10 self.price = price
11
12 def cost(self):
13 '''
14 Return the cost as shares*price
15 '''
16 return self.shares * self.price
17
18 def sell(self, nshares):
19 '''

Callers 1

portfolio_costFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected