Arithmetic Operators Example in Python.
#Arithmetic Operators with variables
a = 10
b = 4
print("The
Initialized value of A is = ",
a);
print("The
Initialized value of B is = ",
b);
print()
print("Addition
Operator : A + B = ", a+b)
print("Subtraction
Operator : A - B = ", a-b)
print("Multiplication
Operator : A * B = ", a*b)
print("Division
Operator : A / B = ", a/b)
print("Floor
Division Operator : A // B = ",
a//b)
print("Modulus
Operator : A % B = ", a%b)
print("Exponent
Operator : A ** B = ", a**b)
Output
>>>
The
Initialized value of A is = 10
The
Initialized value of B is = 4
Addition
Operator : A+B = 14
Subtraction
Operator : A-B = 6
Multiplication
Operator: A*B = 40
Division
Operator : A/B = 2.5
Floor
Division Operator: A//B= 2
Modulus
Operator : A%B = 2
Exponent
Operator : A**B= 10000
>>>
No comments
Post your comments