As mentioned, the default type of each cell is a code cell, where we write Python expressions. The other type of cell that we have is a text cell, and a text cell is used to actually write text. In the cell below the output, let's type This is regular text. To tell the Notebook that this is not Python code and this is actually some text, you go to Cell | Cell Type | Markdown. Let’s run this now and you will find that what you get as output is just the text, the same text we entered:
Jupyter also allows us to format the text in many ways by using markdown syntax. If you are not familiar with markdown, you can go to Help|Markdown, where you will be taken to one of the GitHub help pages.
The markdown that you can use in Jupyter is the same markdown you use in GitHub.
There are many ways you can style and format your text; you can find all the information at: https://help.github.com/articles/basic-writing-and-formatting-syntax/. For this chapter, we will just look at the headings that are very important.
To create a heading, we add one to six # symbols before the heading text. The number of # symbols determines the size of the heading, starting from one to six # symbols, the largest to smallest heading, as follows:
# The largest heading
## The second largest heading
###### The smallest heading
The following screenshot shows the output for the preceding syntax:
If you run them in a code cell, you will get a bunch of Python commands, but we know that we want to see these as formatted text, so we need to tell the Notebook that these are actually texts by marking the cell type as markdown, and when you run the cell you get the preceding result.