So I wrote a very simple python test file called test testProg.py
, and it looks like this:
import sys
def adder(a, b):
sum = a+b
print sum
if __name__ == "__main__":
a = int(sys.argv[1])
b = int(sys.argv[2])
adder(a, b)
From another question here, I did the command:
python testProg.py 3 4
However I get the following error message:
File "testProg.py", line 5
print sum
^
SyntaxError: invalid syntax
I am honestly not sure what the issue it... I can run python from the command prompt easily with no issue, but why cant I replicate that questions' solution?
Thanks.
Edit: Python 3.4 is used