Python: Math Operations

Adds values on either side of the operator

a + b = 30

Subtracts right hand operand from left hand operand

a – b = -10

Multiplies values on either side of the operator

a * b = 200

Divides left hand operand by right hand operand

b / a = 2

Addition Operations

add_number = 4
add_number = 4 + 4
  1. The variable add_number holds a value 4.
  2. Adds another integer 4 and assigns the answer to the same variable.
  3. + ” is plus operator

Subtraction Operations

subtract_number = 9
subtract_number = 9 - 4
  1. The variable subtract_number holds a value 9.
  2. Subtracts another integer 4 and assigns the answer to the same variable.
  3. ” is minus operator

Multiplication Operations

multiply_number = 7
multiply_number = 7 * 5
  1. The variable multiply_number holds a value 7.
  2. Multiply another integer 5 and assigns the answer to the same variable.
  3. ” ٭ ” is multiply operator

Division Operations

divide_number = 7
divide_number = 7 / 5
  1. The variable divide_number holds a value 7.
  2. Divide another integer 5 and assigns the answer to the same variable.
  3. ” / ” is divide operator