Invalid syntax error

Compiling failed with exitcode 1, compiler output:
File “prog.py”, line 15
print("(%s,%d)"%(i,j),end=" ")
^
SyntaxError: invalid syntax

MY CODE WORKING PERFECTLY OKAY IN OTHER IDE BUT GIVING SYNTAX ERROR HERE ON SUBMISSION. I DON’T THINK IT’S A SYNTAX ERROR AT ALL.

I think it is because in Python 3, print statement has been replaced with a print() function, with keyword arguments to replace most of the special syntax of the old print statement. But if you write this in a program and someone using Python 2.x tries to run it, they will get an error. To avoid this, it is a good practice to import print function:

from __future__ import print_function

Now your code works on both python2 and python3