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

Function portfolio_report

Solutions/4_4/report.py:49–61  ·  view source on GitHub ↗

Make a stock report given portfolio and price data files.

(portfoliofile, pricefile)

Source from the content-addressed store, hash-verified

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