Sometimes we don’t want to show the code during presentation of the notebook, or sometimes the code can look really clumsy. Taking care of the code while tearing your hairs to find a better solution to a problem simultaneously is quite a mammoth task. Most tutorials on the web would suggest you to install nbextensions, an open-source notebook extension package for Jupyter notebooks. Definitely that is clean and easy, but I just don’t like installing things and junking up my workstation, rather I’d write a custom code to solve the problem. Here, I have a solution which probably many of you may find useful to hide the input cells of a notebook without installing anything extra at all.
On the first cell of your notebook just paste this code snippet and Run the cell (Ctrl-Enter or Shift-Enter).
Once you run the cell, you will probably see it disappear. So here went the code, but now how to use it!
To hide a cell, just write hide_me as the first line of the cell followed by whatever you need to write after it. That’s it.
I have this tested for Jupyter notebook server version 5.3.1 on Python 3.6.1. This should work for you all well!