‫Now, let's start learning pythons syntaxes by performing some basic arithmetic operations.
‫The most basic operation is addition of two numbers we can use, plus symbol to do that.
‫So we will write two plus two and we will execute this cell by pressing alt or enter.
‫You can see we are getting result as an output.
‫Second, arithmetic operation is substraction.
‫We can use minus symbol, so if it write five, minus two and execute it, we are getting the result
‫Next is multiplication.
‫We can use asterisk symbol
‫To multiply two numbers, if we write three into four and execute it,
‫We are getting twelve as our output.
‫Next is division.
‫We'll write five slash two.
‫Now, to use power or exponential functions, we can use two asterisk symbols.
‫So if I write five asterisk asterisk two.
‫Means that we are squaring five.
‫Next is Modulus or reminder function.
‫It will return the remainder of the division.
‫So if I write five modulus two, we are getting one as our result.
‫So if we divide five by two, we get one.
‫As a reminder, we can also use multiple operators.
‫So I can write five into two plus four.
‫If I execute this command, I will get 14 as a result.
‫You can notice that Python is following the Boardmass rule. First
‫It is multiplying 5 and 2
‫Then it is adding 4 to that result.
‫It is better to use parentheses while using multiple operators.
‫So if we want to add two and four first and then multiply it with five, we can write five
‫and in parenthesis we can write two plus four.
‫You can see here we are first adding 2 and 4 which is 6, and then multiplying this number
‫with the five.
‫So the result is 30.
‫When you are using multiple operators, it is always recommend to use parenthesis.
‫We can also assign these values to variable so I can assign where one.
‫Equal to 2.
‫So now, my variable
‫where one is containing a value two.
‫If I just write where 1 and execute it, python will display it's value.
‫Well, you can see now we are getting two as an output.
‫We can also use arithmetic operators while defining the variable.
‫So if I just change the value of var1 to our previous argument, that is five into two plus four.
‫Our var 1 will now contain a value 14.
‫You can also notice that we have replaced the value 2
‫With Value 14.
‫So if you re assign value to some variable, it will just replace that value.
‫Now, python also supports comparison operators.
‫So if I write five greater than two.
‫The result is true.
‫Similarly, it also supports less than less than equal to and more than equal to.
‫So, for example, I can write three less than equal to
‫2 the result should be false.
‫And we are getting false as our output.