Inplace vs Standard Operators in Python

Inplace operation is an operation which directly changes the content of a given linear algebra or vector or metrices without making a copy. Now the operators, which helps to do this kind of operation is called in-place operator.
Let’s understand it with an a simple example -
a=9
a += 2
print(a)
11
Above the += tie input operator. Here first, a add 2 with that a value is updated the previous value.
Above principle applies to other operators also. Common in place operators are -
+=
-=
*=
/=
%=
Above principle applies to other types apart from numbers, for example -
language = "Python"
language +="3"
print(language)
Python3
Above example of x+=y is equivalent to x = operator.iadd(x,y)
There are multiple operators which are used for inplace operations.
This function is used to assign the current value and add them. This operator does x+=y operation.
x =operator.iadd(9,18)
print("Result after adding: ", end="")
print(x)
Result after adding: 27
This function is used to assign the current value and subtract them. Isub() function does x-=y operation.
x =operator.isub(9,18)
print("Result after subtraction: ", end="")
print(x)
Result after subtraction: -9
This function is used to assign the current value and multiply them. This operator does x*=y operation.
x =operator.imul(9,18)
print("Result after multiplying: ", end="")
print(x)
Result after multiplying: 162
This function is used to assign the current value and divide them. This operator does x/=y operation.
x =operator.itruediv(9,18)
print("Result after dividing: ", end="")
print(x)
Result after dividing: 0.5
this function is used to assign the current value and divide them. This operator does x %=y operation.
x =operator.imod(9,18)
print("Result after moduls: ", end="")
print(x)
Result after moduls: 9
This function is used to concatenate two strings.
x = "Tutorials"
y = "Point"

str1 = operator.iconcat(x,y)
print(" After concatenation : ", end="")
print(str1)
After concatenation : TutorialsPoint
This function is equivalent to x **=y.
x =operator.ipow(2,6)
print("Result after exponent: ", end="")
print(x)
Result after exponent: 64
Operators are the constructs which can manipulate the value of operands.
For example in the expression- 9+18 = 27, here 9 and 18 are operands and + is called operator.
Types of Operator
Python language supports the following types of operators -
Arithmetic Operators: (for example: +, -, *, /, %, **, //)
Arithmetic Operators: (for example: +, -, *, /, %, **, //)
Comparision Operators: (for example: “==”, “!=”, “<>”, “>”, “<”, “>=”, “<=”)
Comparision Operators: (for example: “==”, “!=”, “<>”, “>”, “<”, “>=”, “<=”)
Assignment Operators: (for example: “=”, “+=”, “-=”, “*=”, “/=”, “%=”, “**=”, “//=”)
Assignment Operators: (for example: “=”, “+=”, “-=”, “*=”, “/=”, “%=”, “**=”, “//=”)
Logical Operators: (for example: “Logical AND”, “Logical OR”, “Logical NOT”)
Logical Operators: (for example: “Logical AND”, “Logical OR”, “Logical NOT”)
Bitwise Operators: (for example: “|”, “&”, “^”, “~”, “<<”, “>>”)
Membership Operators: (for example: in, not in)
Membership Operators: (for example: in, not in)
Identity Operators: (for example: is, is not)
Identity Operators: (for example: is, is not)
Below is a table showing how abstract operations correspond to operator symbols in the Python syntax and the functions in the operator module.