Yes, you can hide both Input and Output cells, as well as any other type, by setting the Cell expression option
False. This is most frequently done by:
- Selecting the entire cell or cells using the cell brackets
- Following the Menu path: Cell > Cell Properties and un-checking Open.
It can also be done using the Option Inspector (Shift+Ctrl+O on Windows), or programmatically with e.g.
In addition to closing the cells you can also collapse the cell group as described in your question or by using Ctrl+' to produce a very compact structure with only a minimal bracket remaining for selection.