Python Operators(contd)-6(b)
Let us continue the discussion with Python Assignment Operators Everything that has been shared on the blogs must be noted in the register regularly. Please read the description and example carefully Assume variable a holds 10 and variable b holds 20 , then − a+=2 is using the shorthand operator. Normal assignment would be a=a+2. So, "+=" is the shorthand operator. Operator Description Example = Assigns values from right side operands to left side operand c = a + b assigns value of a + b into c += Add AND It adds right operand to the left operand and assign the result to left operand c += a is equivalent to c = c + a -= Subtract AND It subtracts right operand from the left operand and assign the result to left operand c -= a is equivalent to c = c - a *= Multiply AND It multiplies right operand with the left operand and assign the result to left operand c *= a is equivalent to c = c * a /= Divide AND It di...