- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

**Definition** - In-place operation is an operation that changes directly the content of a given linear algebra, vector, matrices(Tensor) without making a copy. The operators which helps to do the operation is called in-place operator.

Eg: a+= b is equivalent to a= operator.iadd(a, b)

There are some operators are used for In-place operation.

This function is used to assign the current value and add them. This operator does **x+=y** operation. In case of strings, numbers assigning is not performed.

a =operator.iadd(1, 3); print ("The result after adding : ", end="") print(a)

The result after adding: 5

This function is used to assign the current value and subtract them. This operator does **x-=y** operation. In case of strings, numbers assigning is not performed.

a =operator.isub(8, 6); print ("The result after subtracting : ", end="") print(a)

The result after subtracting: 2

This function is used to assign the current value and multiply them. This operator does **x*=y** operation. In case of strings, numbers assigning is not performed.

a =operator.imul(8, 6); print ("The result after multiplying : ", end="") print(a)

The result after multiplying: 48

This function is used to assign the current value and divide them. This operator does **x/=y** operation. In case of strings, numbers assigning is not performed.

a =operator.itruediv(54, 6); print ("The result after dividing : ", end="") print(a)

The result after dividing: 9

This function is used to assign the current value and divide them. This operator does **x%=y** operation. In case of strings, numbers assigning is not performed.

a =operator.imod(10, 5); print ("The result after modulus : ", end="") print(a)

The result after modulus: 2.0

This function is used to concatenate two strings.

a= "jupyter” b = "notebook" t =operator.iconcat(a, b) print (" After concatenation : ", end="") print (t)

After concatenation : jupyter notebook

- Related Questions & Answers
- Inplace vs Standard Operators in Python
- Python Inplace Operators - iadd(), isub(), iconcat()
- Inplace Operators in Python - ixor(), iand(), ipow()
- Inplace Operators in Python - iadd(), isub(), iconcat()
- Operator Functions in Python
- Ternary Operator in Python?
- What is @ operator in Python?
- String Formatting Operator in Python
- Types of Operator in Python
- Explain function of % operator in Python.
- What is tilde (~) operator in Python?
- What is modulo % operator in Python?
- What is operator binding in Python?
- What is a dot operator in Python?
- What is function of ^ operator in Python

Advertisements