Table of Contents
Complete Video Learning
Table of Contents
Assignment operators are used to assigning values to variables.
Operator | Same As | Example |
---|---|---|
= | x = 5 | x = 5 |
+= | x = x + 3 | x += 3 |
*= | x = x * 3 | x *= 3 |
-= | x = x – 3 | x -= 3 |
/= | x = x / 3 | x /= 3 |
%= | x = x % 3 | x %= 3 |
//= | x = x // 3 | x //= 3 |
**= | x = x ** 3 | x **= 3 |
&= | x = x & 3 | x &= 3 |
|= | x = x | 3 | x |= 3 |
^= | x = x ^ 3 | x ^= 3 |
>>= | x = x >> 3 | x >>= 3 |
<<= | x = x << 3 | x <<= 3 |
Addition of two number
x = 8
y = 3
print(x + y)
SHOW YOUR SUPPORT FOR NIELITBHU..!!
Dear reader, thank you for joining us. Readers like you are an inspiration for us to pursue NIELITBHU. We need your support or cooperation to further empower NIELITBHU and reach NIELITBHU more people in every corner of the country. Your every support is invaluable to our future.