If you encounter problems like this that are connected to a wrong sequence of you running your code cells restarting the kernel and running the cells again in correct order is in most cases good advice.
You can restart your kernel by pressing the 0
key on your keyboard twice.