Code format distorted in notebook

I am unable to run this piece of code because in the notebook for the exercise the code is distorted. It is represented as text. I have tried on different browsers but I am facing the same issue.

It seems that two cells have been combined into one - the first part should be a Markdown cell, and the second part (which contains the Python function) should be a Code cell.

The easiest way to fix this is for you to rename your notebook ipynb file (so that you can refer to it later), and then get a new copy of the assignment.

Following @TMosh reply I was able to resolve the issue by highlighting the code cell and changing the cell type to code instead of markdown and that worked.

Yes, it’s pretty easy with an accidental click to change the type of a cell. The other alternative for anyone who hits this case and can’t easily figure out which cell has been set incorrectly is to get a fresh copy of the notebook and start over. Here’s the process for Coursera. If you are taking the course on the DLAI Learning Platform, then here are the instructions.