Hope you all are having a great day, let’s make it better by learning something new.
Today, we will talk about numbers.
What are number?
We have 1,2,3,4,… and so on called as positive numbers or natural numbers.
If we add zero to above series, its called whole numbers.
If we have numbers like -1, -2, -3, … and so on , these are called negative numbers.
If we combine above series then we have … -3, -2, -1, 0, 1, 2, 3 and all these number together are called as integers.
Numbers with fraction part are considered floating point numbers or floats. For example : 2.342, 1.324, 2.3, 3.1415
In programming, we have 6 types of basic arithmetic operations :
- Addition : Represented by ‘+’ sign
5+2 = 7
- Subtraction : Represented by ‘-‘ sign
5-2 = 3
- Multiplication : Represented by ‘*’ sign
5*2 = 10
- Division : Represented by ‘/’ sign
5/2 = 2.5
- Modulo : Represented by ‘%’ sign
5%2 = 1
This basically helps us to get remainder value. When 5 is divided by 2 it leaves 1 as remainder and 2 as quotient
- Power : Represented by ‘**’ sign
5**3 = 5*5*5 = 125
This means 5 to the power of 3.
Sixth point is special, that works with python but not with other languages. Other operations can be used in other languages as well.
We can practice doing this and use python for arithmetic and as a calculator.
- Start python by just typing python in Command prompt or power shell.
- Type in all the examples shown above, in python shell and see python do calculation for you.
That’s it for this tutorial.
See you guys, in the next tutorial.