Arithmetic
Arithmetic Operators in Computer Programming
# Example Variables
a = 10
b = 5
# Addition
sum = a + b # sum will be 15
# Subtraction
difference = a - b # difference will be 5
# Multiplication
product = a * b # product will be 50
# Division
quotient = a / b # quotient will be 2.0 (or 2 in integer division)
# Modulo
remainder = a % b # remainder will be 0Last updated
Was this helpful?