
Jupyter Notebook Introductory Session : Beginners to Advance¶# The blue color outside the cell re`presents command mode.
# And the green color indicates edit mode.
# Press 'Esc' to get into command mode.
# Press 'Enter' to go back into edit mode.
# Press 'P' to view the list of all available commands.
# This is a coding cell.
# Let's write your first Python program here.
Name = input("Enter your name: ")
print("Hello,", Name)
# Press 'Shift + Enter' to execute the cell.
# Writing comments in a code cell can sometimes creates confusion. Jupyter notebook works both as a notebook and a coding console.
# To write explanatory texts, you can use a markdown cell which enables you to format your comments well to create a more
# readable code.
# Let's now learn about markdown cells, then.
# Press 'M' in command mode to convert a code cell to a Markdown cell.
This is a Markdown Cell. Double click on a markdown cell or press 'Enter' to see how it's written. And again, press 'Shift + Enter' to execute the cell.
Let's further learn about the various customizations in a markdown cell to create a more readable and understandable code.
Use a back single quotation mark (`) to get monospace fonts.
This text will appear in monospace font.
Python is a beautiful language.
Sometimes in the markdown cells, you don't get a line break where you want simply by pressing enter. In such cases use <br> to get a manual line break.
I want a line break here.
But I don't get it. :/
So I used a manual line break
There we go! :)
Use > to indent your text.
This is the first line
This indents the second line.
This further indents it.
And this goes on and on.
'- ' creates a bullet.1. (1 followed by a dot and a space) to get a numbered list.Jupyter notebook also supports LaTeX equations. Use a $ on either side to write a LaTeX equation.
The below example is just a hypothetical equation to explain how you can write LaTeX equations in Jupyter notebook.
$(\frac{a_1}{a_2} + \frac{a_3}{a_4})^2 = a_5^3$
Go through this link if you want to learn the LaTeX syntax.
That was all about markdown cells. Now let us take a look at the most useful commands that you require everyday while coding in the Jupyter notebook.
Esc: To go into command modeEnter: To go back to edit modeM: To convert a cell to a markdown cellY: To convert a cell back to a code cellA: To insert new cell aboveB: To insert new cell belowD + D: To delete cellZ: Undo last operationF: To find and replace on your codeShift + Up/Down: To select multiple cellsSpace: Scroll notebook downwardsShift + Space: Scroll notebook upwardsShift + Enter: To execute the code in the current cell and go to the next cellAlt + Enter: To execute the code in the current cell and insert new cell belowShift + Tab: To get a brief documentation of the object that you have just typed in the coding cellCtrl + Shift + -: To split the cell at cursorShift + M: To merge selected cellsApart from this, you can also use H to open the list of keyboard shortcuts and even add new shortcuts or customize the existing shorcuts according to your personal requirements.