forked from sanketpatil02/Code-Overflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment Operators
More file actions
26 lines (25 loc) · 1.11 KB
/
Assignment Operators
File metadata and controls
26 lines (25 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Program to show all Python Assignment Operators */
>>> a = 7
>>> Total = 21
>>> Total += a # Using += Operator
>>> print("The Value of the Total after using += Operator is: ", Total)
>>> Total -= a # Using -= Operator
>>> print("The Value of the Total after using -= Operator is: ", Total)
>>> Total *= a # Using *= Operator
>>> print("The Value of the Total after using *= Operator is: ", Total)
>>> Total //= a # Using //= Operator
>>> print("The Value of the Total after using //= Operator is: ", Total)
>>> Total **= a # Using **= Operator
>>> print("The Value of the Total after using **= Operator is: ", Total)
>>> Total /= a # Using /= Operator
>>> print("The Value of the Total after using /= Operator is: ", Total)
>>> Total %= a # Using %= Operator
>>> print("The Value of the Total after using %= Operator is: ", Total)
>>> x = 9
>>> y = 65
>>> x &= y # Using &= Operator
>>> print("The Value of the x after using &= Operator is: ", x)
>>> x |= 9 # Using |= Operator
>>> print("The Value of the x after using |= Operator is: ", x)
>>> x ^= y # Using ^= Operator
>>> print("The Value of the x after using ^= Operator is: ", x)