Table of Contents
show
- Arithmetic operators are used with numeric values to perform common mathematical operations
- Consider a = 5 b = 10
Example
a = 3
b = 2
print("a+b = ", a+b)
print("a-b =",a-b)
print("a*b =",a*b)
print("a/b =",a/b)
print("a%b=",a%b)
print("a**b = ", a**b)
print("a//b =",a//b)
Output
('a+b = ', 5)
('a-b =', 1)
('a*b =', 6)
('a/b =', 1)
('a%b=', 1)
('a**b = ', 9)
('a//b =', 1)
Views: 2