# Code format distorted in notebook

**URL:** <https://community.deeplearning.ai/t/code-format-distorted-in-notebook/895004>\
**Category:** Linear Algebra for Machine Learning and Data Sc...\
**Tags:** week-module-2, coursera-platform\
**Created:** [September 8, 2026, 6:33am UTC](https://community.deeplearning.ai/t/code-format-distorted-in-notebook/895004 "2026-09-08T06:33:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanielSogbey](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/danielsogbey/32/166285_2.png) [@DanielSogbey](https://community.deeplearning.ai/u/DanielSogbey)\
**Post date:** [September 8, 2026, 6:33am UTC](https://community.deeplearning.ai/t/code-format-distorted-in-notebook/895004/1 "2026-09-08T06:33:27Z")

</div>

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.

 ![Screenshot 2026-09-08 at 6.29.45 AM](https://global.discourse-cdn.com/dlai/original/3X/7/1/71e2842840138e1b069b45bb448e59567d68ad48.png)

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [September 8, 2026, 7:25am UTC](https://community.deeplearning.ai/t/code-format-distorted-in-notebook/895004/2 "2026-09-08T07:25:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DanielSogbey](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/danielsogbey/32/166285_2.png) [@DanielSogbey](https://community.deeplearning.ai/u/DanielSogbey)\
**Post date:** [September 8, 2026, 10:53am UTC](https://community.deeplearning.ai/t/code-format-distorted-in-notebook/895004/4 "2026-09-08T10:53:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [September 8, 2026, 4:11pm UTC](https://community.deeplearning.ai/t/code-format-distorted-in-notebook/895004/5 "2026-09-08T16:11:13Z")

</div>

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.](https://community.deeplearning.ai/t/how-to-get-a-clean-copy-of-an-assignment-notebook/73) If you are taking the course on the DLAI Learning Platform, then [here are the instructions.](https://learn.deeplearning.ai/faq/refreshing-your-workspace)
