## Intro:

Guido van Rossum created 'Python' which is a high-level and object oriented programming language in 1991. With emphasis on code readability, and its syntax allows programmers to express their concepts in fewer lines of code and almost like human readable language.

That's how the journey of learning the language of snake starts!

## π΅ Numbers:

There are various data types in Python. Today we will only talk about **Numbers** and how to do basic math in Python. We know that there are **two** types of basic numbers in arithmetic. They are as follow:

__Integer (int):__

Positive or negative whole numbers (without a fractional part).

For example: 10,5000000,-35__Floating-point (float):__

Any real numbers with βdecimalβ points or floating-point representation.

For example: -5.678,190.90

And with either of these numbers you can perform basic arithmetic as you would expect.

## π£Arithmetic Operations:

##
__Addition:__

Here, 1 and 1 are operands, and "+" is the operator computing addition.

##
__Multiplication:__

Here, 1 and 3 are operands, and "*" is the operator computing multiplication in python. We cannot use "x" or "X" for this command.

##
__Division:__

Here, 1 and 2 are operands, and "/" is the operator computing multiplication in python. We cannot use **Γ·** for this command. Division of numbers always yields a **float.**

##
__Exponentiation:__

Basically it's the power operator. Here, 2 and 4 are operands, and "**" is the operator computing exponents in python.

π’Now we will introduce to two more exciting arithmetic operations that we will use regularly in Python. i.e. **floor division** and **modulus.**

##
**Floor Division:**

**Floor Division:**

In this arithmetic operation, the double-backslash operator (//) is the floor division operator.

Floor division of integers results in an integer. If one of the operands is float, then the floor division results in a float.

Here we can see, 7 divided by 5 yields 1.4 . But while using the floor division (//), it basically discards the part after the decimal point and returns a whole number by flooring the value to the nearest integer number. i.e. 1

##
**Modulus:**

**Modulus:**

In this arithmetic operation, the percentage sign (%) is the modulus operator and it basically returns the remainder after division. **It works as a brilliant checker for finding odd or even number. **
To check whether the number is odd or even, we have to **mod** by 2 and if the remainder yields zero then its a even number. Otherwise, the number is odd.

**For example:**

We can see that 4 divide by 2 yields quotient 2 and remainder 0. So the number is even.

## π‘ Order of Precedence:

After learning all the arithmetic operations, we need to know the order of precedence of them.__ i.e. PEMDAS
__

We know that Python executes from __top to bottom__ and reads code from **left** to **right**. Now, let us see a compound expression below:

**Here, according to PEMDAS, operations in brackets should be carried out first.** After that, from left to right we can see that next in line is multiplication and then division. Lastly, addition is done.

That's all for today! Feel free to ask me any question if you don't understand.

## Top comments (0)