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

Function portfolio_report

Solutions/3_16/report.py:41–53  ·  view source on GitHub ↗

Make a stock report given portfolio and price data files.

(portfoliofile, pricefile)

Source from the content-addressed store, hash-verified

39 print('%10s %10d %10.2f %10.2f' % row)
40
41def portfolio_report(portfoliofile, pricefile):
42 '''
43 Make a stock report given portfolio and price data files.
44 '''
45 # Read data files
46 portfolio = read_portfolio(portfoliofile)
47 prices = read_prices(pricefile)
48
49 # Create the report data
50 report = make_report_data(portfolio, prices)
51
52 # Print it out
53 print_report(report)
54
55def main(args):
56 if len(args) != 3:

Callers 1

mainFunction · 0.70

Calls 4

read_portfolioFunction · 0.70
read_pricesFunction · 0.70
make_report_dataFunction · 0.70
print_reportFunction · 0.70

Tested by

no test coverage detected