![]() |
arithmetic operation in python pro in python |
ADDITION OPERATOR :
We also perform arithmetic operations using print we see in below
addition operation :
- print(1+2)
output : 3
You want to print as it is :
- print("1+2")
output : 1+2
- we also print multiple items with using comas
- example :
- print(1+2, 2+3)
- output : 3 5
subtraction :
example :
- print(2-1)
- output : 1
area and perimeter :
Formula of AREA : length * breadth
Formula for perimeter : 2* (length + breath)
we see example in below
length = 11
breath = 13
floating point division :
divide a/b
a=10
b=3
divide a/b
a=10
b=2
modulus division :
divide a/b
a=10
b=3
reminder= 1
Exponent Magic Trick
2 double every day after 3 days what will the you have in python to print(2**3). this means 2*2*2 and output is 8 .
- You have to must try in your python compiler use idle avoid online compilers to Errors
- More operators and operations in
- Quiz about Arithmetic Operations In Python
0 Comments