mathematical operations in Python

Dear,
     Viewers  Please give your valuable feed on my side and give me a advice how can I improve my blog? and how can I improve my knowledge in python..

Kindly leave your comments please...


Today we are going to see what are all main math operators and  how they are working in python.

Main operators in Python

1. Addition +
2. Subtraction -
3. Multiplication *
4. Division /
5. Modulus
6. Exponent **
7. Floor Division //

Out of the above program

Example Programs written by me

mport math
x = int(input('Enter your age :'))
y = int(input('My age :'))
print('Multiplication of our age is = {}'.format(x*y))
print('Addition of our age is = {}'.format(x+y))
print('Subtraction of our age is = {}'.format(x-y))
print('Division of our age is = {}'.format(x/y))
print('Modulus of our age is = {}'.format(x%y))
print('Floor division of our age is = {}'.format(x//y))
 
Out of the above program
 
Enter your age : 40
My age : 20
Multiplication of our age is = 800
Addition of our age is = 60
Subtraction of our age is = 20
Division of our age is = 2
Modulus of our age is = 0
Floor division of our age is = 2

 

Comments

Popular Posts