Error: local variable 'cost_sum' referenced before assignment

Hi,
anybody had the same error during the WK2 assigment?
Despite simple code, I struggle to make it run.
It would help me to start fresh with the assigment as well, any chance to reset the whole sheet?
Thanks in advance.

To restore the original notebook you can follow the instructions in this post.

Be sure you run all of the cells from the top of the notebook every time you open it .

Hi both, thanks for hints.
I restored the file by reverting to a checkpoint from Dec 22nd 2022 - this seems to clear all mods. Yet, after running all cells and writing code below, I’m still having the same error:
Any hints please?

Thank you

Problem solved, I did not define all variables.