Make a list of (name, shares, price, change) tuples given a portfolio list and prices dictionary.
(portfolio,prices)
| 38 | return prices |
| 39 | |
| 40 | def make_report_data(portfolio,prices): |
| 41 | ''' |
| 42 | Make a list of (name, shares, price, change) tuples given a portfolio list |
| 43 | and prices dictionary. |
| 44 | ''' |
| 45 | rows = [] |
| 46 | for stock in portfolio: |
| 47 | current_price = prices[stock['name']] |
| 48 | change = current_price - stock['price'] |
| 49 | summary = (stock['name'], stock['shares'], current_price, change) |
| 50 | rows.append(summary) |
| 51 | return rows |
| 52 | |
| 53 | def print_report(reportdata): |
| 54 | ''' |
no test coverage detected