I am just getting started with Python and wrote a simple perimeter program. However whenever I type python perimeter.py in my terminal I get the following error I don't know how to solve it.
>>> python perimeter.py
File "<stdin>", line 1
python perimeter.py
^
SyntaxError: invalid syntax
What is that problem? How do I fix it?
Thanks.
You type python perimeter.py in your command shell to start the Python interpreter. You don't type it in the Python interpreter.
If you really need to run the script from within the Python interpreter, do execfile('perimeter.py').
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With