Whenever you open a notebook, you always need to run all of the cells starting from the top.
That’s how the packages are imported and the environment is initialized.
Then it might be possible that you have deleted/modified some line of code or cell. Please get a clean copy of your assignment, as described here, and do your code again without changing/deleting the pre-written code and comments.