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

Method sell

Solutions/7_4/stock.py:33–37  ·  view source on GitHub ↗

Sell a number of shares and return the remaining number.

(self, nshares)

Source from the content-addressed store, hash-verified

31 return self.shares * self.price
32
33 def sell(self, nshares):
34 '''
35 Sell a number of shares and return the remaining number.
36 '''
37 self.shares -= nshares

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected