Skip to content

Commit c5ba227

Browse files
committed
updated assignment operator script
1 parent 1f6eb52 commit c5ba227

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

#8_Python_Assignment_Compound_Operator.py

+29-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,32 @@
1414
# >>= x >>= 5 x = x >> 5
1515
# <<= x <<= 5 x = x << 5
1616

17-
x=5
18-
#output=a+
19-
print ("a+ output is :",(x += 5),)
17+
a = 10
18+
b = 20
19+
c = 0
20+
21+
print ("a value is ",a)
22+
print ("b value is ",b)
23+
print ("c value is ",c)
24+
25+
c = a + b
26+
print ("Line 1 - Value of c is (c=a+b) ", c)
27+
28+
c += a
29+
print ("Line 2 - Value of c is (c +=a)", c)
30+
31+
c *= a
32+
print ("Line 3 - Value of c is (c *=a)", c)
33+
34+
c /= a
35+
print ("Line 4 - Value of c is (c /=a)", c)
36+
37+
c = 2
38+
c %= a
39+
print ("Line 5 - Value of c is (c %=a)", c)
40+
41+
c **= a
42+
print ("Line 6 - Value of c is (c **= a) ", c)
43+
44+
c //= a
45+
print ("Line 7 - Value of c is (c //=a)", c)

0 commit comments

Comments
 (0)