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

Function portfolio_report

Solutions/3_18/report.py:43–55  ·  view source on GitHub ↗

Make a stock report given portfolio and price data files.

(portfoliofile, pricefile)

Source from the content-addressed store, hash-verified

41 print('%10s %10d %10.2f %10.2f' % row)
42
43def portfolio_report(portfoliofile, pricefile):
44 '''
45 Make a stock report given portfolio and price data files.
46 '''
47 # Read data files
48 portfolio = read_portfolio(portfoliofile)
49 prices = read_prices(pricefile)
50
51 # Create the report data
52 report = make_report_data(portfolio, prices)
53
54 # Print it out
55 print_report(report)
56
57def main(args):
58 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