Hello and welcome back to our second class of our introduction to Jupiter.
So basically in today's class, we are going to learn how to work with Jupiter and we are going to write
down some basic lines of code once again before starting this class.
I highly suggest you guys to have some basic knowledge of Python because we are going to write down
our first lines of code.
Of course, I'm going to explain them to you.
But once again, to be able to follow the course and not focus only on Python, you guys should have
some basic knowledge.
So let's jump right into it.
The first thing that I'll ask you to do is open up your Anaconda Navigator and launch your Jupiter notebook
simply by clicking the button right here.
So when it's all done, it's going to be launched.
Next thing that we want to do is pretty simple.
We want to open up a new folder.
So in this case, it's going to be a Python three.
When it's all done, they will simply give a name to our folder, let's call it project in this case.
So the first thing that we are going to talk about right here is pretty simple.
We are going to talk about how we're how works the notebook and what exactly you guys can do with,
well, how exactly you can work with it.
And what is the difference between the chapter in the notebook and any other text editor?
Well, text editor, for example, like by chance.
So let's start basically the first thing that you guys have inside of your notebook.
This would be your main page.
You will have the buttons right here so they'll be able to save your changes.
Pretty simple to simply click on the button right here.
And usually it's going to be automatically saved.
So as you can see, the safe mode is activated.
So it's going to be automatically saved then in your term or any other text editor, you usually don't
have cells inside of your notebook and you have cells.
So there is not only one cell.
You can have more than one cell.
For example, if I want to add a cell, it's going to be by clicking on the little plus sign right here.
So pretty simple.
I can add as many cells as I want and it's pretty cool because it allows me to really organize my code.
So say I want to write down a function right here on a store.
Some variables right here.
I want to write down another function right here.
And which is pretty cool is that I can move my cells from up to them if you guys want to duplicate your
cell.
Well, first of all, if you want to delete, your cell is going to be there.
So simply click on the scissors.
If you guys want to duplicate your cells, it's going to be here so you can select a copy cell and you
can copy your cell.
So let's say, for example, we have a cell right here.
We will write down something simple.
So a simple function.
Let's print pizza, for example.
Here we go.
I have my function, so I run my function.
I have pizza right here.
Let's say I want to copy this cell right there.
And I past myself.
And as you can see, it's it's television and it has been copied and pasted down there.
All right, so pretty simple if I want to move myself, so let's say I have more than one cell.
I have a lot of cells.
I can take this code right here and move it from up to down.
So right now, I have absolutely nothing.
I just have a print function with PDA inside of it.
That doesn't mean nothing.
But let's say, for example, I have variables right here that I want to work with them down there.
I can do it.
I can just have my variables here.
And let's say I want to put them down here.
I have a function where I want to take a function and move it somewhere higher or anything.
I can move my cells how I want, which is pretty cool in this case with Jupiter.
All right.
Next thing to run are apps to run our code.
I mean, it's going to be just there.
You simply click on the run button.
If you want to stop the code that is running, it's going to be on the little interrupt button right
here.
So this is for the basics of well, of Python, but of Jupiter.
Sorry.
So it's pretty simple.
As you can see, it's pretty simple to use.
Next thing that we are going to talk about would be our first python lines of code.
So how exactly can we work with it?
So as you saw some seconds before in this with the Jupiter, you don't you don't have a terminal down
here like you do in, for example, by terms.
So basically, if you write down your code, it's going to be printed right under the cell right there.
So just for the purpose, to understand how Jupiter works and for the purpose of everybody who is in
the course and maybe don't understand Python that much, will write down a very simple line of code.
And I will explain really the basics of Python, which we'll talk about variables, numbers and booleans.
So let's set it up.
The first thing that we'll do is simply create two variables that are strings.
So in this case, let's say we will call it name one and name what?
Name to it, name zero.
And in this case, let's name our name Will.
Our name variable will be pizza.
So for those who never really programmed and are right now writing down their first lines of code,
what I'm doing right now is I'm creating my variables, which is a name and name two, and I'm storing
strings inside of my variable.
So I created two variables.
The first one is called the name and the second variable is called name two.
I have three types of variables, which could be strings or plaintext.
Strings are simply plaintext.
I have numbers which can be one to infinity.
So in this case, let's say we have quantity one and quantity two, those two countries will be numbers.
So in this case, will have number two and number four.
So as you can see here, I have my pizza, I have my pasta.
Those two are strings.
And those variables right here are numbers.
It's possible to transform strings into numbers and numbers into strings, because when you write down
a line of code, you can use both strings and numbers at the same place.
So if you try to run, for example, a sentence that contains numbers and strings, it's not going to
work.
You guys need to transform your strings if you want to use only strings to transform all your numbers
into strings.
So let's write down a very simple line of code and that in this case, this line of code right here.
So what exactly this line of code means?
It's pretty simple.
First of all, I want what exactly do I want?
So when I write down, well, let's start by spring.
So first of all, I have my print function.
I ask, I ask, I give the order to print something.
So what?
I give the order to print.
I give the order to print I want.
So this would be the first part of our function.
This is just plain text.
This is a string.
What I want exactly.
I want quantity one.
So quantity one in this case is the number two.
Why I wrote a story right here.
This is the function that we use to transform numbers into string.
So as I said, we can't have strings and numbers inside of the same sentence.
Then what exactly do I want?
I want quantity one plus name.
This means I want two pizzas.
So we have our quantity one, which is two plus name, which is pizza, plus we have our plaintext or
our string.
And and in this case, we just put it inside of those little parenthesis.
Plus I want quantity and number two in this four in this case it means four plus name two.
In this case it means pasta.
So if we were on our app, logically is going to give us I want two pizzas and four pastas.
So let's try it out.
As you can see right here, we have an airside so what exactly do we have in there?
It's pretty simple because it says quantity one is not defined, pretty simple.
Let's try something else.
So usually the error comes when you guys just don't add the little space bar.
And as you can see here, it works so pretty simple.
The problem was simply right here.
So there were no spaces and this is how the erosion.
So this is a typical error with Jupiter that you guys can have.
Sometimes just a little space button will make it work or not work.
So really, be careful about it.
I'm not going to give you a complete course of how to how to debug all errors, because once again,
this is just a really basic line of code.
Certainly.
Yes.
Understand how exactly works in Jupiter.
So it's pretty simple.
Jupiter is, as I said, a text editor and what a notebook.
And you can use it to write down your lines of code.
And right now, you know exactly how it works, how all what all the buttons right here means and how
everything works.
Don't forget to save your works are pretty simple.
You simply save it.
So the sweet next time that you connect to your chapter, you will be able to see your work.
So in this case, if, for example, we decided to click on X right here, we have our project, which
is right there, we can just run it so we can simply click on our project.
And as you can see, we will have our project right here.
So that's it for this class guys, into our next class.