So let's get started with our crash course attached to this lecture, you find a file that was named
Crash Course Dot IPY, N.B..
Download this file and save it on your hard disk drive and then open it in Jupyter Notebook.
Of course, you don't have to do this.
You can also start with a completely new file and ride along with me.
So I think the first few lectures are really, really easy.
So this is why I have prepared them for you, and we will just run the notes, book together to see
what happens.
So the first thing that we are going to do is we are going to import a module called Nampai.
And for this, we write import Nampai.
And this would already be sufficient.
But in most of the notebooks that you use NumPy, they write something like import nampai, s and P.
So this means whenever in the following, we would have to write Nampai, we just have to write and
Pete.
So Nampai is a module that contains many useful mathematical commands.
For example, the constant PI or the Oilers constant or also the square root command and these commands,
they are not initially built in to Python.
So we first need to load them using this module.
This is why in basically every scientific code, one of the first lines will be important Um, P, S
and P.
So we write this and run it using shift enter.
And now we are going to start with some basic mathematics.
By the way, if you wonder how I wrote this line here, I will double click.
And you see, I just wrote with down hashtag hashtag for a subheading.
And then my basic mathematics and I have turned to sell cell type into markdown and then press shift
enter.
So you will get this bold text.
So let's continue with the very basic mathematical operations.
I mean, I think this will be totally clear to you that a plus means addition.
So you can use Python just like a calculator for addition, subtraction, multiplication and division.
And you you see already that when you divide two integer numbers, it can also give you a float number
as a result, which is not the case in every programming language.
So for some languages, this would give us just two, because the result in this case should be an integer
number in these languages.
But Python is really clever about the data types and adapts on the fly, so you don't have to bother
with these problems.
If, however, you want to really execute an into an integer division or integral division, then you
can write two of these dashes.
And this will give us 10 the integer solution, which is two if you only care about the remainder or
also called modulus.
Then you write the percentage sign and you write five percentage two, which gives us the remainder
of this division, which is, of course, one.
Another important operator is, of course, the exponent.
So if you write two of these stars, then this means three to the power of two.
Or also this means three squared.
So the square of three is, of course, nine and vice versa.
You can also calculate the square root of nine by writing nine to the power of one half or 0.5.
So here this is maybe a bit of a detail, but so Python itself does not have a square root command.
It does not exist in the Python language, and it has to be imported with the Nampai module.
So, for example, if we would just write something like square root of nine, which would work in most
languages, this would give us an error because square root is not defined.
And to use the conventional square root, we would either have to use this one here or we use Nampai
Dot Square Root, because then it loads the square root command from the non-paid module that we have
imported right at the top here.
So now we can run this, and of course, it gives us three point zero as well.
So as I mentioned, Non also contains several useful constants like Pi or E, and you can easily access
those by writing and pitot and then the constant that you need.
The last thing that I want to show you before we continue with the next topic will be that, of course,
you are able to define variables.
For example, you can just write a is some number like three and then you just write four times a minus
five, which will give us.
Twelve minus five is seven.
So you see, all of this basic stuff can be done, of course, with Python.
But you have to be careful sometimes because some of the functions that you might think are implemented
in Python are actually not implemented.
And for those, you will need to load a module like Nampai.
So this would be square roots and also these constants.