How to compute daily profits and losses (PnLs) for investments
Quizzes and Answers
Quiz 1: Write a Python function that calculates how much money an investment is worth each day if the following data are given: 1) daily PnL data, and 2) initial money spent on the investment



Quiz 2: Calculation of asset returns should be independent of how much money an investor puts in. That is to say, if an asset has a return of 10% between two days, then the return is always 10% during that period whether you invested $100 or $1,000 on it. Based on function single_asset_invest_daily_return, write a new Python function asset_daily_return(price_data, begin_date, end_date) so that the function doesn’t take money_spent as an argument but still gives exactly the same daily returns as before.

