So we have we started this zoo pattern book from an icon the navigator.
Now to create a new notebook.
Click on this new button in the top right corner and click on python 3.
This will open a new notebook in a new term.
This is before you buy the notebook interface and notebook you write and run your codes in a small segments
and these segments are called cells.
Apart from executing your code the cells can also be used for commenting.
And it is really helpful to make your code readable and easy to follow.
To write the code.
You just have to click on the cell for example to add two numbers.
You can just write two plus two.
So this is where you will write your codes to execute this code.
Just press control enter
so you can write to records in the cell and you will get the output just below.
You can see for input we have an end.
And for all the outputs we have out
on the top you can see different menu items file contains general options like saving printing or renaming
added content set related options like cards cell copy cell based cell or delete cell
view contains interface related options and inserts contains option to insert new cells
sense menu item contents execution related options and as the name suggests contains references and
manuals on how to use your python notebook you can also find the list scrolls shortcuts from here.
Now most of the options we are going to use are also available in the form of buttons.
So suppose if I want to rename this file as lecture one I will do that by clicking on this file filing
undated and just rename it to lecture 1
to save this file.
We can click on the save button
it will automatically save your file in your default directory and next time you opened your python
notebook you will be able to see this file in your default directory from Dubai the notebook homepage.
There are also buttons to cut copy paste.
We also have a button to execute our codes.
So again if I if I click on my cell and click on print it will execute an.
Now you can see this drop down menu is seen code.
This means the cell we have selected is containing the code.
If I want it to contain a comment I can change it to either draw on my long form writing if I change
it to mark down or draw out Python cardinal will know that the sale the content of this particular cell
is just for commenting and not execute the presence of this feature.
Make a word code more readable and understandable so I will go ahead and change the format of this setting
to M.D. which is Mondo.
You can see when I'm changing my cell to mark down the input symbol goes away.
There is no input symbol here and put symbols are present on the in the front of quotes.
I can write anything in this MDL and by 10 groups.
This as a command.
So let's go ahead and write.
This is a MDL
Mal known cells also supports modern formatting.
So if I want to give heading I can use bond symbol
so will give a hiding hiding one
if I execute this set
you can see since I use bond symbol in front of this hiding one the fine for hiding one is in the hiding
format
we can also use my people found symbols to change their size.
So if I use two symbols for heading to
you can see heading to is slightly smaller than heading one.
You can also use three four five or six bond symbol to change the size of the settings.
You can also use esoteric symbols to give bootlegs.
So if I write a strict.
If I write.
Bullet point this abstract symbol will be directly converted into a bullet so
executed.
You can see the stick symbols are now converted into bullet and we are seeing all the white points and
crop and bullet points.
There are multiple features for editing Mondo.
You can Google it and if you want you can learn more about this for my things.
I'll get no no.
No not just for commenting your Python is not actually executing this since
the next cell format is little ROIs similar to own but it does not support for my thing.
So if you convert it to raw
if you convert it to draw it will remain like this.
You will not be able to get formatting out of this cells again.
Roy's also for commenting and python will not executed
code is the format in which we write our codes.
And python will only execute cells that are among death squads.
You can see the format for this cell is code.
Therefore I can use my codes in this cell so if I write two plus two I can execute it either by clicking
this round button or by pressing the shortcut key that is control enter.
For now I will click on this red button.
Similarly if I write 5 plus 3 this time I will lose control under control and there is a shortcut to
run the cell to execute the same
but most of the time we also want to enter a blank cell.
Been in this cell.
In that case I can use it and that instead of controlling that or can under will execute the cell.
Also it will insert a blank cell just below the cell so right or enter it has executed the cell and
it has inserted a new cell a new blank cell just below this cell.
Another small point I want to tell you about cells is editable and known ended up with mode.
So let's first insert a new cell now if you try to write anything.
So if I write start occurred Academy nothing will happen because these cells are not editable right.
No.
You can also notice the color of the cell is blue the border around the cell is blue.
This suggests that the cell currently is in non entity but for my a few press I'm dead you can see the
cursor inside the cell and on the blue color has been changed to green color.
Now you can write anything if I write a start decorating me you can see we are able to write this inside
a cell.
This mode is a readable mode.
If I press escape you can see the color has been changed to blue and now we have entered a non editable
mode and normally they will mode you can navigate through different cell and if you want to edit it
you have to press enter and the cursor will appear inside the cell and the cell boundary will change
to green color these two shortcuts of entering into a readable and non entry table mode are very important
and it will lay a foundation for other shortcuts as well.
So suppose if you want to change the formatting from code to modern you can put your cell into non readable
mode so I will press escape and then I will press and M is a shortcut for modern formatting and you
can see that the stereotype type has been changed from code to Mundo since.
Right now I am in non editable mode.
I can press VI to change the format of this cell to code.
Now do I did the code I just have to press enter to enter into editable mode.
Now again to go back to ON OUR do table press escape now I can use shortcuts touching this self automate
if I press are I can change the format of this cell to roll and to switch back.
I just have to press why this shortcuts are very handy when you are using Python and it will save a
lot of pain for you
again.
Now the shortcut to insert new cell is just to enter into a non editable mode.
Let's escape if you are in editable mode and place a evil insert a blank cell above your existing cell
and similarly B will enter a cell below your existing cell
so I want you to remember this sixth shortcut for stays and that to enter into editable mode of a cell.
Second this escape to go into the non editable mode of the cell.
Third is control and better to execute your selected cell.
Fourth one is or should enter to execute your selected cell and entered a new blank cell below your
cell.
The fifth one is M. use of M and non-native table more.
It will change the cell format from code to modern and the last one is via in the non editable mode.
If you press way it will change the format of your cell from raw or marked down to code format.
Similarly there is one more shortcut if you want to delete your cell.
Just press BD in non editable mode actually delete the selected cell in the next lecture will cover
some basic operations and Python.