0
why does not my interpreter run this code?
#!/usr/bin/python a = 21 b = 10 c = 0 c = a + b print "Line 1 - Value of c is ", c c = a - b print "Line 2 - Value of c is ", c c = a * b print "Line 3 - Value of c is ", c c = a / b print "Line 4 - Value of c is ", c c = a % b print "Line 5 - Value of c is ", c a = 2 b = 3 c = a**b #Exponent - Performs exponential (power) calculation on operators print "Line 6 - Value of c is ", c a = 10 b = 5 c = a//b #Floor Division - The division of operands where the result is the quotient in which the digits after
2 Answers
+ 2
This code only supports an old version of the Python interpreter. Yours I assume is already up to date, which causes errors. To make this code run, just put a set of parentheses in your print statements and replace the comma inside those statements with a plus sign. For example:
print ("Line 1 - Value of c is " + c)
0
thanks