Python Assignment Operators Example
Example: !/usr/bin/python a = 21 b = 10 c = 0 c = a + b print “Line 1 – Value of c is “, c c += a print “Line 2 – Value of c is “, c c *= a print “Line 3 – Value of c is “, c c /= a … Read more
Example: !/usr/bin/python a = 21 b = 10 c = 0 c = a + b print “Line 1 – Value of c is “, c c += a print “Line 2 – Value of c is “, c c *= a print “Line 3 – Value of c is “, c c /= a … Read more
Operators are the constructs which can manipulate the value of operands. Consider the expression 4 + 5 = 9. Here, 4 and 5 are called operands and + is called operator. Types of Operator Python language supports the following types of operators. Python Arithmetic Operators Assume variable a holds 10 and variable b holds 20, … Read more