- Addition Operator :
num1 = 7
num2 = 3
#using the addition operator
result = num1+num2
print(result)
Output : 10
- Subtraction Operator :
num1 = 7
num2 = 3
#using the subtraction operator
result = num1-num2
print(result)
Output : 4
- Multiplication Operator :
num1 = 7
num2 = 3
#using the multiplication operator
result = num1*num2
print(result)
Output : 21
- Division Operator :
num1 = 7
num2 = 2
#using the Division operator
result = num1/num2
print(result)
Output : 3.5
- Modulus Operator :
num1 = 7
num2 = 3
#using the Modulus operator
result = num1%num2
print(result)
Output : 1
- Exponentiation Operator :
num1 = 7
num2 = 2
#using the Exponential operator
result = num1**num2
print(result)
Output : 49
- Floor division :
num1 = 7
num2 = 2
#using the Floor division operator
result = num1//num2
print(result)
Output : 3
A= 5 B= 2 print(“Addition : “, A+B) print(“Subtraction : “, A-B) print(“Multiplication : “, A*B) print(“Division : “, A/B) print(“Modulus : ” , A%B) print(“Exponentiation : “, A**B) print(“Floor division : “, A//B) |
Output
Addition : 7 Subtraction : 3 Multiplication : 10 Division : 2.5 Modulus : 1 Exponentiation : 25 Floor division : 2 |