HOME C C++ PYTHON JAVA HTML CSS JAVASCRIPT BOOTSTRAP JQUERY REACT PHP SQL AJAX JSON DATA SCIENCE AI

Python Assignment Operators

Assignment operators are used to assign values to variables.

Types of Assignment Operators


Operator Example Same as
= a=10 a=10
+= a+=10 a=a+10
-= a-=10 a=a-10
*= a*=10 a=a*10
/= a/=10 a=a/10
%= a%=10 a=a%10
//= a//=10 a=a//10
**= a**=10 a=a**10
&= a&=10 a=a&10
|= a|=10 a=a|10
^= a^=10 a=a^10
//= a//=10 a=a//10
>>= a>>=10 a=a>>10
<<= a<<=10 a=a<<10