I am doing an coding exercise using Python and obtain values from a csv.file. My questions on the assignment is to:

“Calculate the average change in “Profit/Losses” between months over the entire period.”

I know in my head to get this answer mathematically the formula would be something like “Average change in profit_loss = (Amount of last row - Amount of first row) / (Total length - 1)”

I’m getting an error message on not defining the variables. If I used last row and first row as my variable. What would it be equal too? I’m using the values from this csv file.